mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 10:55:40 -04:00
Be less spammy in privmsg
This commit is contained in:
parent
a01d80b90a
commit
f6e0fbd506
1 changed files with 4 additions and 4 deletions
|
@ -558,9 +558,9 @@ sub plugin_output {
|
|||
$copy->{name} = $said->{forwarding};
|
||||
my $newtext = $said->{name} . " wanted you to know: ". $text;
|
||||
$_[KERNEL]->yield(plugin_output => $copy, $newtext);
|
||||
$said->{channel} = "*irc_msg";
|
||||
$said->{channel} = "*irc_msg";
|
||||
delete $said->{forwarding};
|
||||
$_[KERNEL]->yield(plugin_output => $said, "Told ".$copy->{name}." about ".$text);
|
||||
$_[KERNEL]->yield(plugin_output => $said, "Told ".$copy->{name}." about ".$text);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -577,13 +577,13 @@ sub plugin_output {
|
|||
# that receive multiple lines and those that don't..
|
||||
$text = Encode::encode( "utf8", $text ); # set it up for raw bytes now
|
||||
while( length $text ) {
|
||||
my $substr = substr( $text, 0, 400, '' );
|
||||
my $substr = substr( $text, 0, 200, '' );
|
||||
$pci->yield( privmsg => $said->{name} => $substr );
|
||||
|
||||
# Try to avoid sending too many lines, since it may be annoying
|
||||
# and it tends to prevent the bot from sending other messages.
|
||||
|
||||
last MESSAGES if $messages_sent++ > 60;
|
||||
last MESSAGES if $messages_sent++ > 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue