diff options
Diffstat (limited to 'saxrobot')
-rwxr-xr-x | saxrobot | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -25,7 +25,7 @@ $irc->plugin_add('NickServID', POE::Component::IRC::Plugin::NickServID->new( POE::Session->create( package_states => [ - main => [ qw(_default _start irc_001 irc_public irc_msg) ], + main => [ qw(_default _start irc_001 irc_kick irc_public irc_msg) ], ], heap => { irc => $irc }, ); @@ -52,6 +52,15 @@ sub irc_001 { return; } +sub irc_kick { + my ($kicker, $channel, $kickee, $reason) = @_[ARG0 .. ARG3]; + if ($kickee eq $config{nick}) { + print "I was kicked by $kicker ($reason). Rejoining now.\n"; + $irc->yield(join => $channel); + } + return; +} + sub irc_public { my ($sender, $who, $where, $what) = @_[SENDER, ARG0 .. ARG2]; my $nick = ( split /!/, $who )[0]; |