def irc_NOTICE(self, client, message): ctcp = util.parse_ctcp(message.args[1]) if ctcp: ctcp_args = None if len(ctcp) > 1: ctcp_args = ctcp[1] client.trigger_handler('ctcp_reply', message.source, message.args[0], ctcp[0], ctcp_args) client.trigger_handler('ctcp_reply_'+ctcp[0].upper(), message.source, message.args[0], ctcp_args) else: if util.is_server(message.source.nick): client.trigger_handler('server_notice', message.source.nick, message.args[1]) if util.is_channel(message.args[0]): client.trigger_handler('channel_notice', message.source, message.args[0], message.args[1]) else: client.trigger_handler('private_notice', message.source, message.args[1])
def irc_PRIVMSG(self, client, message): ctcp = util.parse_ctcp(message.args[1]) if ctcp: ctcp_args = None if len(ctcp) > 1: ctcp_args = ctcp[1] if ctcp[0] == "ACTION": if util.is_nick(message.args[0]): client.trigger_handler('private_action', message.source, ctcp_args) else: client.trigger_handler('channel_action', message.source, message.args[0], ctcp_args) else: #client.trigger_handler('ctcp_request', message.source, message.args[0], ctcp[0], ctcp_args) client.trigger_handler('ctcp_request_'+ctcp[0].upper(), message.source, message.args[0], ctcp_args) else: if util.is_channel(message.args[0]): client.trigger_handler('channel_message', message.source, message.args[0], message.args[1]) else: client.trigger_handler('private_message', message.source, message.args[1])