3
0
mirror of https://github.com/pragma-/pbot.git synced 2025-09-08 21:17:25 +02:00

Core/IRC/Connection: dispatch pbot.public/pbot.caction events for bot messages

This commit is contained in:
Pragmatic Software 2025-09-04 10:27:57 -07:00
parent 6147a5afc7
commit cdef9e5fe8
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE
2 changed files with 13 additions and 1 deletions

View File

@ -1436,6 +1436,18 @@ sub sl_real {
return unless defined $self->socket;
# dispatch pbot.public or pbot.action event
if ($line =~ m/^PRIVMSG (.*?) :(.*)$/) {
my $to = $1;
my $msg = $2;
if ($msg =~ m/^\x01ACTION (.*)\x01$/) {
$self->{_pbot}->{event_dispatcher}->dispatch_event('pbot.caction', { to => $to, msg => $1 });
} else {
$self->{_pbot}->{event_dispatcher}->dispatch_event('pbot.public', { to => $to, msg => $msg });
}
}
if ($self->{_utf8}) { $line = encode('UTF-8', $line); }
my $rv = eval {

View File

@ -25,7 +25,7 @@ use PBot::Imports;
# These are set by the /misc/update_version script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 4886,
BUILD_REVISION => 4887,
BUILD_DATE => "2025-09-04",
};