mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 12:32:37 +01:00
Plugins/RemindMe: ensure option -c is in channel format
This commit is contained in:
parent
77420ae20b
commit
1158c36ce1
@ -196,6 +196,11 @@ sub cmd_remindme {
|
|||||||
return "Please use -t to specify a time for this reminder." if not $time;
|
return "Please use -t to specify a time for this reminder." if not $time;
|
||||||
return "Please specify a reminder message." if not $text;
|
return "Please specify a reminder message." if not $text;
|
||||||
|
|
||||||
|
# ensure option -c is a channel
|
||||||
|
if (defined $channel and $channel !~ /^#/) {
|
||||||
|
return "Option -c must be a channel.";
|
||||||
|
}
|
||||||
|
|
||||||
# option -c was provided; ensure bot is in channel
|
# option -c was provided; ensure bot is in channel
|
||||||
if ($channel and not $self->{pbot}->{channels}->is_active($channel)) {
|
if ($channel and not $self->{pbot}->{channels}->is_active($channel)) {
|
||||||
return "I'm not active in channel $channel.";
|
return "I'm not active in channel $channel.";
|
||||||
@ -290,7 +295,7 @@ sub do_reminder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# send reminder text to person
|
# send reminder text to person
|
||||||
my $target = $reminder->{channel} // $nick;
|
my $target = $reminder->{channel} || $nick;
|
||||||
my $text = $reminder->{text};
|
my $text = $reminder->{text};
|
||||||
|
|
||||||
# if sending reminder to channel, highlight person being reminded
|
# if sending reminder to channel, highlight person being reminded
|
||||||
|
Loading…
Reference in New Issue
Block a user