mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 18:35:49 -04:00
Relax some limits in #perlbot
This commit is contained in:
parent
c954380c04
commit
2ccaad88d2
1 changed files with 15 additions and 12 deletions
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue