Only parse CTCP when we're not in a TAGMSG event
This commit is contained in:
parent
d610282c9e
commit
8b796c159f
1 changed files with 15 additions and 13 deletions
|
@ -60,21 +60,23 @@ def message(events, event):
|
||||||
"target_str": target_str, "user": user, "tags": event["tags"]}
|
"target_str": target_str, "user": user, "tags": event["tags"]}
|
||||||
|
|
||||||
action = False
|
action = False
|
||||||
ctcp_message = utils.irc.parse_ctcp(message)
|
|
||||||
|
|
||||||
if ctcp_message:
|
if message:
|
||||||
if not ctcp_message.command == "ACTION" or not event["command"
|
ctcp_message = utils.irc.parse_ctcp(message)
|
||||||
] == "PRIVMSG":
|
|
||||||
if event["command"] == "PRIVMSG":
|
if ctcp_message:
|
||||||
direction = "request"
|
if not ctcp_message.command == "ACTION" or not event["command"
|
||||||
|
] == "PRIVMSG":
|
||||||
|
if event["command"] == "PRIVMSG":
|
||||||
|
direction = "request"
|
||||||
|
else:
|
||||||
|
direction = "response"
|
||||||
|
events.on("received.ctcp").on(direction).on(ctcp_message.command
|
||||||
|
).call(message=ctcp_message.message, **kwargs)
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
direction = "response"
|
message = ctcp_message.message
|
||||||
events.on("received.ctcp").on(direction).on(ctcp_message.command
|
action = True
|
||||||
).call(message=ctcp_message.message, **kwargs)
|
|
||||||
return
|
|
||||||
else:
|
|
||||||
message = ctcp_message.message
|
|
||||||
action = True
|
|
||||||
|
|
||||||
if not message == None:
|
if not message == None:
|
||||||
kwargs["message"] = message
|
kwargs["message"] = message
|
||||||
|
|
Loading…
Reference in a new issue