diff options
| author | 2018-09-09 17:09:04 +0100 | |
|---|---|---|
| committer | 2018-09-09 17:09:04 +0100 | |
| commit | 59912776c1769d4d15cae4dd07133a9f7dfe1126 (patch) | |
| tree | 24514a0f170e9bfec1fb14a4bf13dab5aa6d3b21 /modules/commands.py | |
| parent | Change default priority to "medium", add priority lower than "low" ("monitor") (diff) | |
Make commands be processed under received.message.* at PRIORITY_LOW, eat the
event when it's done, change karma.py to use PRIORITY_MONITOR
Diffstat (limited to 'modules/commands.py')
| -rw-r--r-- | modules/commands.py | 10 |
1 files changed, 6 insertions, 4 deletions
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="<command>") @@ -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", |
