mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-18 06:20:41 +01:00
Core/Handlers: Do not auto-reply to NOTICEs
This commit is contained in:
parent
2b36286c22
commit
48daaa91ca
@ -26,23 +26,14 @@ sub on_notice($self, $event_type, $event) {
|
|||||||
$event->{args}[0],
|
$event->{args}[0],
|
||||||
);
|
);
|
||||||
|
|
||||||
# don't handle non-chat NOTICE
|
# don't handle server NOTICE
|
||||||
return undef if $to eq '*';
|
return undef if $to eq '*';
|
||||||
|
|
||||||
# log notice
|
# log notice
|
||||||
$self->{pbot}->{logger}->log("NOTICE from $nick!$user\@$host to $to: $text\n");
|
$self->{pbot}->{logger}->log("NOTICE from $nick!$user\@$host to $to: $text\n");
|
||||||
|
|
||||||
# if NOTICE is sent to the bot then replace the `to` field with the
|
# nothing further to do with NOTICEs
|
||||||
# sender's nick instead so when we pass it on to on_public ...
|
return undef;
|
||||||
if ($to eq $self->{pbot}->{registry}->get_value('irc', 'botnick')) {
|
|
||||||
$event->{to}[0] = $nick;
|
|
||||||
}
|
|
||||||
|
|
||||||
# handle this NOTICE as a public message
|
|
||||||
# (check for bot commands, anti-flooding, etc)
|
|
||||||
$self->on_public($event_type, $event);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub on_public($self, $event_type, $event) {
|
sub on_public($self, $event_type, $event) {
|
||||||
|
@ -67,7 +67,7 @@ sub on_notice($self, $event_type, $event) {
|
|||||||
# notice from NickServ
|
# notice from NickServ
|
||||||
if (lc $nick eq lc $nickserv) {
|
if (lc $nick eq lc $nickserv) {
|
||||||
# log notice
|
# log notice
|
||||||
$self->{pbot}->{logger}->log("NOTICE from $nick!$user\@$host to $to: $text\n");
|
$self->{pbot}->{logger}->log("Services NOTICE from $nick!$user\@$host to $to: $text\n");
|
||||||
|
|
||||||
# if we have enabled NickServ GUARD protection and we're not identified yet,
|
# if we have enabled NickServ GUARD protection and we're not identified yet,
|
||||||
# NickServ will warn us to identify -- this is our cue to identify.
|
# NickServ will warn us to identify -- this is our cue to identify.
|
||||||
|
@ -25,8 +25,8 @@ 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 => 4674,
|
BUILD_REVISION => 4675,
|
||||||
BUILD_DATE => "2023-05-11",
|
BUILD_DATE => "2023-05-14",
|
||||||
};
|
};
|
||||||
|
|
||||||
sub initialize {}
|
sub initialize {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user