3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-27 13:12:42 +01:00

Add subroutines to release and identify nick if necessary

This commit is contained in:
Pragmatic Software 2014-05-31 01:07:29 +00:00
parent 60d8235999
commit 4696df7ea1
2 changed files with 19 additions and 1 deletions

View File

@ -244,6 +244,24 @@ sub on_departure {
}
}
sub on_notregistered {
my ($self, $conn, $event) = @_;
my ($addr, $msg) = $event->args;
$self->{pbot}->{logger}->log("Received NOTREGISTERED from $addr: $msg\n");
$conn->privmsg("nickserv", "release " . $self->{pbot}->{registry}->get_value('irc', 'botnick') . ' ' . $self->{pbot}->{registry}->get_value('irc', 'identify_password'));
$conn->privmsg("nickserv", "identify " . $self->{pbot}->{registry}->get_value('irc', 'botnick') . ' ' . $self->{pbot}->{registry}->get_value('irc', 'identify_password'));
}
sub on_bannickchange {
my ($self, $conn, $event) = @_;
my ($addr, $nick, $msg) = $event->args;
$self->{pbot}->{logger}->log("Received BANNICKCHANGE from $addr: $nick ($msg)\n");
$conn->privmsg("nickserv", "release " . $self->{pbot}->{registry}->get_value('irc', 'botnick') . ' ' . $self->{pbot}->{registry}->get_value('irc', 'identify_password'));
$conn->privmsg("nickserv", "identify " . $self->{pbot}->{registry}->get_value('irc', 'botnick') . ' ' . $self->{pbot}->{registry}->get_value('irc', 'identify_password'));
}
sub on_nickchange {
my ($self, $conn, $event) = @_;
my ($nick, $user, $host, $newnick) = ($event->nick, $event->user, $event->host, $event->args);

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 605,
BUILD_REVISION => 606,
BUILD_DATE => "2014-05-30",
};