From fcbb7c960ce8c9b693711b4b40d3fa86fd17d7cf Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 19 Sep 2018 13:25:12 +0100 Subject: Refactor everything to use delimited events --- modules/to.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'modules/to.py') diff --git a/modules/to.py b/modules/to.py index 849f3af6..22b9c7ac 100644 --- a/modules/to.py +++ b/modules/to.py @@ -2,13 +2,12 @@ import EventManager class Module(object): def __init__(self, bot, events, exports): - events.on("received").on("message").on("channel" - ).hook(self.channel_message, + events.on("received.message.channel").hook(self.channel_message, priority=EventManager.PRIORITY_HIGH) - events.on("received").on("command").on("to").hook( - self.to, min_args=2, help=("Relay a message to a " - "user the next time they talk in a channel"), - channel_only=True, usage=" ") + events.on("received.command.to").hook(self.to, min_args=2, + help=("Relay a message to a user the next time they talk " + "in this channel"), channel_only=True, + usage=" ") def channel_message(self, event): messages = event["channel"].get_user_setting(event["user"].get_id(), -- cgit v1.3.1-10-gc9f91