diff --git a/modules/commands.py b/modules/commands.py index a500c75d..9b1b1aad 100644 --- a/modules/commands.py +++ b/modules/commands.py @@ -1,5 +1,5 @@ import re -import Utils +import EventManager, Utils STR_MORE = "%s (more...)" % Utils.FONT_RESET STR_CONTINUED = "(...continued) " @@ -48,8 +48,10 @@ class Module(object): def __init__(self, bot, events, exports): self.bot = bot self.events = events - events.on("received.message.channel").hook(self.channel_message) - events.on("received.message.private").hook(self.private_message) + events.on("received.message.channel").hook(self.channel_message, + priority=EventManager.PRIORITY_LOW) + events.on("received.message.private").hook(self.private_message, + priority=EventManager.PRIORITY_LOW) events.on("received.command.help").hook(self.help, help="Show help for commands", usage="") @@ -153,7 +155,7 @@ class Module(object): target.last_stdout = stdout target.last_stderr = stderr buffer.skip_next() - + event.eat() def channel_message(self, event): command_prefix = event["channel"].get_setting("command-prefix", diff --git a/modules/karma.py b/modules/karma.py index 5f6e5178..cb11e9ff 100644 --- a/modules/karma.py +++ b/modules/karma.py @@ -1,5 +1,5 @@ import re, time -import Utils +import EventManager, Utils REGEX_KARMA = re.compile("(.*)(\+{2,}|\-{2,})$") KARMA_DELAY_SECONDS = 3 @@ -10,7 +10,7 @@ class Module(object): self.events = events events.on("new").on("user").hook(self.new_user) events.on("received").on("message").on("channel").hook( - self.channel_message) + self.channel_message, priority=EventManager.PRIORITY_MONITOR) events.on("received").on("command").on("karma").hook( self.karma, help="Get your or someone else's karma", usage="[target]")