mirror of
https://github.com/pragma-/pbot.git
synced 2025-10-14 06:57:25 +02:00
Core/IRC/Connection: dispatch pbot.public/pbot.caction events for bot messages
This commit is contained in:
parent
6147a5afc7
commit
cdef9e5fe8
@ -1436,6 +1436,18 @@ sub sl_real {
|
|||||||
|
|
||||||
return unless defined $self->socket;
|
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); }
|
if ($self->{_utf8}) { $line = encode('UTF-8', $line); }
|
||||||
|
|
||||||
my $rv = eval {
|
my $rv = eval {
|
||||||
|
@ -25,7 +25,7 @@ use PBot::Imports;
|
|||||||
# These are set by the /misc/update_version script
|
# These are set by the /misc/update_version script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 4886,
|
BUILD_REVISION => 4887,
|
||||||
BUILD_DATE => "2025-09-04",
|
BUILD_DATE => "2025-09-04",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user