mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 10:59:29 +01:00
Timer: update eventqueue
usage message
This commit is contained in:
parent
177328b627
commit
85a98d5a8b
@ -52,7 +52,7 @@ sub initialize {
|
|||||||
sub event_queue_cmd {
|
sub event_queue_cmd {
|
||||||
my ($self, $from, $nick, $user, $host, $arguments, $stuff) = @_;
|
my ($self, $from, $nick, $user, $host, $arguments, $stuff) = @_;
|
||||||
|
|
||||||
my $usage = "Usage: eventqueue list [filter regex] | add <relative time> <command> | remove <regex>";
|
my $usage = "Usage: eventqueue list [filter regex] | add <relative time> <command> [-repeat] | remove <event>";
|
||||||
|
|
||||||
my $command = $self->{pbot}->{interpreter}->shift_arg($stuff->{arglist});
|
my $command = $self->{pbot}->{interpreter}->shift_arg($stuff->{arglist});
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ sub event_queue_cmd {
|
|||||||
|
|
||||||
if ($command eq 'add') {
|
if ($command eq 'add') {
|
||||||
my ($duration, $command) = $self->{pbot}->{interpreter}->split_args($stuff->{arglist}, 2);
|
my ($duration, $command) = $self->{pbot}->{interpreter}->split_args($stuff->{arglist}, 2);
|
||||||
return "Usage: eventqueue add <relative time> <command>" if not defined $duration or not defined $command;
|
return "Usage: eventqueue add <relative time> <command> [-repeat]" if not defined $duration or not defined $command;
|
||||||
|
|
||||||
my ($delay, $error) = $self->{pbot}->{parsedate}->parsedate($duration);
|
my ($delay, $error) = $self->{pbot}->{parsedate}->parsedate($duration);
|
||||||
return $error if defined $error;
|
return $error if defined $error;
|
||||||
@ -116,7 +116,7 @@ sub event_queue_cmd {
|
|||||||
|
|
||||||
if ($command eq 'remove') {
|
if ($command eq 'remove') {
|
||||||
my ($regex) = $self->{pbot}->{interpreter}->split_args($stuff->{arglist}, 1);
|
my ($regex) = $self->{pbot}->{interpreter}->split_args($stuff->{arglist}, 1);
|
||||||
return "Usage: eventqueue add <regex>" if not defined $regex;
|
return "Usage: eventqueue remove <event>" if not defined $regex;
|
||||||
$regex =~ s/\*/.*?/g;
|
$regex =~ s/\*/.*?/g;
|
||||||
print "regex: [$regex]\n";
|
print "regex: [$regex]\n";
|
||||||
return $self->dequeue_event($regex);
|
return $self->dequeue_event($regex);
|
||||||
|
Loading…
Reference in New Issue
Block a user