aboutsummaryrefslogtreecommitdiff
path: root/IRCLineHandler.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-07-02 11:08:04 +0100
committerGravatar jesopo2018-07-02 11:08:04 +0100
commit1148aad8a4e0331f63b1bc664122e9c1e5cff073 (patch)
tree3abd4bfcffc9ac9991e2e79230afac1e289f4b7d /IRCLineHandler.py
parentRemove commented example raw IRC line from IRCLineHandler (diff)
signature
added handle_KICK to IRCLineHandler
Diffstat (limited to 'IRCLineHandler.py')
-rw-r--r--IRCLineHandler.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/IRCLineHandler.py b/IRCLineHandler.py
index 011cb409..296dd60e 100644
--- a/IRCLineHandler.py
+++ b/IRCLineHandler.py
@@ -338,3 +338,19 @@ def handle_477(data):
bot.add_timer("rejoin", 5, channel_name=data.args[1],
key=data.server.attempted_join[data.args[1].lower()],
server_id=data.server.id)
+
+@handler(description="someone's been kicked from a channel")
+def handle_KICK(data):
+ nickname, username, hostname = Utils.seperate_hostmask(data.prefix)
+ user = data.server.get_user(nickname)
+ target = data.args[1]
+ channel = data.server.get_channel(data.args[0])
+ reason = data.args[2]
+
+ if not data.server.is_own_nickname(target):
+ target_user = data.server.get_user(target)
+ bot.events.on("received").on("kick").call(channel=channel,
+ reason=reason, target_user=target_user, user=user, **data.map())
+ else:
+ bot.events.on("self").on("kick").call(channel=channel,
+ reason=reason, user=user, **data.map())