mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-23 03:02:47 +01:00
Make usage output of some commands visible in channel instead of msg
This commit is contained in:
parent
eabb249d79
commit
c150e2018c
@ -84,7 +84,7 @@ sub factset {
|
|||||||
my ($channel, $trigger, $key, $value) = split / /, $arguments, 4 if defined $arguments;
|
my ($channel, $trigger, $key, $value) = split / /, $arguments, 4 if defined $arguments;
|
||||||
|
|
||||||
if(not defined $channel or not defined $trigger) {
|
if(not defined $channel or not defined $trigger) {
|
||||||
return "/msg $nick Usage: factset <channel> <factoid> [key <value>]"
|
return "Usage: factset <channel> <factoid> [key <value>]"
|
||||||
}
|
}
|
||||||
|
|
||||||
return $self->{pbot}->factoids->factoids->set($channel, $trigger, $key, $value);
|
return $self->{pbot}->factoids->factoids->set($channel, $trigger, $key, $value);
|
||||||
@ -96,10 +96,10 @@ sub factunset {
|
|||||||
my ($channel, $trigger, $key) = split / /, $arguments, 3 if defined $arguments;
|
my ($channel, $trigger, $key) = split / /, $arguments, 3 if defined $arguments;
|
||||||
|
|
||||||
if(not defined $channel or not defined $trigger) {
|
if(not defined $channel or not defined $trigger) {
|
||||||
return "/msg $nick Usage: factunset <channel> <factoid> <key>"
|
return "Usage: factunset <channel> <factoid> <key>"
|
||||||
}
|
}
|
||||||
|
|
||||||
return "/msg $nick " . $self->{pbot}->factoids->factoids->unset($channel, $trigger, $key);
|
return $self->{pbot}->factoids->factoids->unset($channel, $trigger, $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub list {
|
sub list {
|
||||||
@ -206,7 +206,7 @@ sub alias {
|
|||||||
my ($alias, $command) = $arguments =~ /^(.*?)\s+(.*)$/ if defined $arguments;
|
my ($alias, $command) = $arguments =~ /^(.*?)\s+(.*)$/ if defined $arguments;
|
||||||
|
|
||||||
if(not defined $command) {
|
if(not defined $command) {
|
||||||
return "/msg $nick Usage: alias <keyword> <command>";
|
return "Usage: alias <keyword> <command>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$from = '.*' if not defined $from or $from !~ /^#/;
|
$from = '.*' if not defined $from or $from !~ /^#/;
|
||||||
@ -243,7 +243,7 @@ sub add_regex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(not defined $text) {
|
if(not defined $text) {
|
||||||
return "/msg $nick Usage: regex <regex> <command>";
|
return "Usage: regex <regex> <command>";
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($channel, $trigger) = $self->{pbot}->factoids->find_factoid($from, $keyword, undef, 1);
|
my ($channel, $trigger) = $self->{pbot}->factoids->find_factoid($from, $keyword, undef, 1);
|
||||||
@ -350,7 +350,7 @@ sub show {
|
|||||||
my ($chan, $trig) = split / /, $arguments;
|
my ($chan, $trig) = split / /, $arguments;
|
||||||
|
|
||||||
if(not defined $chan or not defined $trig) {
|
if(not defined $chan or not defined $trig) {
|
||||||
return "/msg $nick Usage: show <channel> <factoid>";
|
return "Usage: show <channel> <trigger>";
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($channel, $trigger) = $self->{pbot}->factoids->find_factoid($chan, $trig);
|
my ($channel, $trigger) = $self->{pbot}->factoids->find_factoid($chan, $trig);
|
||||||
@ -374,13 +374,13 @@ sub info {
|
|||||||
my ($chan, $trig) = split / /, $arguments;
|
my ($chan, $trig) = split / /, $arguments;
|
||||||
|
|
||||||
if(not defined $chan or not defined $trig) {
|
if(not defined $chan or not defined $trig) {
|
||||||
return "/msg $nick Usage: info <channel> <trigger>";
|
return "Usage: info <channel> <trigger>";
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($channel, $trigger) = $self->{pbot}->factoids->find_factoid($chan, $trig);
|
my ($channel, $trigger) = $self->{pbot}->factoids->find_factoid($chan, $trig);
|
||||||
|
|
||||||
if(not defined $trigger) {
|
if(not defined $trigger) {
|
||||||
return "/msg $nick '$trig' not found in channel '$chan' (did you mean channel '.*'?";
|
return "'$trig' not found in channel '$chan' (did you mean channel '.*'?";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $created_ago = ago(gettimeofday - $factoids->{$channel}->{$trigger}->{created_on});
|
my $created_ago = ago(gettimeofday - $factoids->{$channel}->{$trigger}->{created_on});
|
||||||
|
@ -13,7 +13,7 @@ use warnings;
|
|||||||
# These are set automatically by the build/commit script
|
# These are set automatically by the build/commit script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 193,
|
BUILD_REVISION => 194,
|
||||||
BUILD_DATE => "2010-06-21",
|
BUILD_DATE => "2010-06-21",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user