From 108f61d40ecd557b778a17b0a0218d56673b6488 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 19 Feb 2020 15:07:25 -0800 Subject: [PATCH] Interpreter: subtract IRC command length from truncation length --- PBot/Interpreter.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/PBot/Interpreter.pm b/PBot/Interpreter.pm index 1bdb0c16..38f550a0 100644 --- a/PBot/Interpreter.pm +++ b/PBot/Interpreter.pm @@ -706,6 +706,7 @@ sub lc_args { sub truncate_result { my ($self, $from, $nick, $text, $original_result, $result, $paste) = @_; my $max_msg_len = $self->{pbot}->{registry}->get_value('irc', 'max_msg_len'); + $max_msg_len -= length "PRIVMSG $from :"; utf8::encode $result; utf8::encode $original_result;