1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 16:15:39 -04:00

Relax some limits in #perlbot

This commit is contained in:
Ryan Voots 2017-04-05 20:41:57 -04:00
parent c954380c04
commit 2ccaad88d2

View file

@ -583,24 +583,27 @@ sub plugin_output {
# 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++ > 5;
last MESSAGES if $messages_sent++ > 30;
}
}
}
elsif ( $said->{channel} eq '*dcc_chat' ) {
$text = Encode::encode( "utf8", $text ); # set it up for raw bytes now
$pci->yield( dcc_chat => $said->{dcc_id} => $text );
}
else {
$text =~ s/\r?\n/ /g;
if ($text =~ /^\x00/) {
$text =~ s/^\x00//;
$text = Encode::encode( "utf8", $text ); # set it up for raw bytes now
$pci->yield( privmsg => $said->{channel} => $text );
} else {
$text = Encode::encode( "utf8", $text ); # set it up for raw bytes now
$pci->yield( privmsg => $said->{channel} => "$said->{name}: $text" );
# TODO make this use the config
$text =~ s/\r?\n/ /g unless $said->{channel} eq '#perlbot';
for my $line (split /\r?\n/, $text) {
unless ($text =~ /^\x00/) {
$line = "$said->{name}: $line";
} else {
$line =~ s/^\x00//;
}
my $rawtext = Encode::encode( "utf8", $line ); # set it up for raw bytes now
$pci->yield( privmsg => $said->{channel} => $rawtext );
}
}