aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2018-08-28 15:14:22 +0100
committerGravatar jesopo2018-08-28 15:14:22 +0100
commitf2b2ac52e725a9e6c86c41fae7245c870cf25030 (patch)
tree4c1fd09c1617545f5e3d8743eae842d63d353b8f
parentexpand kwargs in assure_call when we've got a hook (diff)
Send a PONG event, use the right arg when sending a WHO
-rw-r--r--IRCLineHandler.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/IRCLineHandler.py b/IRCLineHandler.py
index f67beb58..ee48cb71 100644
--- a/IRCLineHandler.py
+++ b/IRCLineHandler.py
@@ -61,11 +61,15 @@ def handle(line, prefix, command, args, is_final, _bot, server):
bot = _bot
handler_function(data)
-@handler(description="reply to a ping")
+@handler(description="received a ping from the server")
def handle_PING(data):
nonce = data.args[0]
data.server.send_pong(nonce)
bot.events.on("received").on("ping").call(nonce=nonce, server=data.server)
+@handler(description="received a pong from the server")
+def handle_PONG(data):
+ nonce = data.args[1]
+ bot.events.on("recevied").on("pong").call(nonce=nonce, server=data.server)
@handler(description="the first line sent to a registered client", default_event=True)
def handle_001(data):
@@ -143,7 +147,7 @@ def handle_353(data):
channel.add_mode(mode, nickname)
@handler(description="on-join user list has finished", default_event=True)
def handle_366(data):
- data.server.send_who(data.args[2])
+ data.server.send_who(data.args[1])
@handler(description="on user joining channel")
def handle_JOIN(data):