diff options
author | David Phillips <david@sighup.nz> | 2017-03-07 12:22:32 +1300 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-03-07 12:47:53 +1300 |
commit | 5013bcc130227bc32086c6da621c0a02051cb1d8 (patch) | |
tree | d3bf7e7c976e64bf147fa0a0e3dbabc697007101 | |
parent | e1a382c7db700b1dc5a9e3e859f4579367624323 (diff) | |
download | idalius-5013bcc130227bc32086c6da621c0a02051cb1d8.tar.xz |
Autorejoin immediately on kick
-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]; |