3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-27 13:12:42 +01:00

Fix fact command to use $stuff; increase factoid keyword length to 30

This commit is contained in:
Pragmatic Software 2017-11-23 14:11:54 -08:00
parent 89d3596dac
commit cea2fc66f9

View File

@ -99,7 +99,7 @@ sub initialize {
sub call_factoid {
my $self = shift;
my ($from, $nick, $user, $host, $arguments) = @_;
my ($from, $nick, $user, $host, $arguments, $stuff) = @_;
my ($chan, $keyword, $args) = split /\s+/, $arguments, 3;
if(not defined $chan or not defined $keyword) {
@ -112,7 +112,10 @@ sub call_factoid {
return "No such factoid '$keyword' exists for channel '$chan'";
}
return $self->{pbot}->{factoids}->interpreter($from, $nick, $user, $host, 1, $trigger, $args, undef, $channel, undef, $trigger);
$stuff->{keyword} = $trigger;
$stuff->{arguments} = $args;
return $self->{pbot}->{factoids}->interpreter($stuff);
}
sub log_factoid {
@ -613,7 +616,7 @@ sub factmove {
}
}
if (length $target > 20) {
if (length $target > 30) {
return "/say $nick: I don't think the factoid name needs to be that long.";
}
@ -680,7 +683,7 @@ sub factalias {
$chan = '.*' if $chan !~ /^#/;
if (length $alias > 20) {
if (length $alias > 30) {
return "/say $nick: I don't think the factoid name needs to be that long.";
}
@ -762,7 +765,7 @@ sub factadd {
}
}
if (length $keyword > 20) {
if (length $keyword > 30) {
return "/say $nick: I don't think the factoid name needs to be that long.";
}