aboutsummaryrefslogtreecommitdiff
path: root/modules/commands.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-09-27 12:08:07 +0100
committerGravatar jesopo2018-09-27 12:08:07 +0100
commit6eb8b1ba6d9aaaf7df42f3d705149f02b6a1b871 (patch)
treeece91b1c4d871d5d2b9a3f6319598e33aa13f93f /modules/commands.py
parentUse ModuleManager.BaseModule in more modules (diff)
signature
Move all exports to @Utils.export calls
Diffstat (limited to 'modules/commands.py')
-rw-r--r--modules/commands.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/modules/commands.py b/modules/commands.py
index 3bc2604f..c60876c3 100644
--- a/modules/commands.py
+++ b/modules/commands.py
@@ -1,5 +1,5 @@
import re
-from src import EventManager, Utils
+from src import EventManager, ModuleManager, Utils
STR_MORE = "%s (more...)" % Utils.FONT_RESET
STR_CONTINUED = "(...continued) "
@@ -43,17 +43,13 @@ class StdErr(Out):
def prefix(self):
return Utils.color(Utils.bold(self.module_name), Utils.COLOR_RED)
-class Module(object):
- def __init__(self, bot, events, exports):
- self.events = events
-
- exports.add("channelset", {"setting": "command-prefix",
- "help": "Set the command prefix used in this channel"})
- exports.add("serverset", {"setting": "command-prefix",
- "help": "Set the command prefix used on this server"})
- exports.add("serverset", {"setting": "identity-mechanism",
- "help": "Set the identity mechanism for this server"})
-
+@Utils.export("channelset", {"setting": "command-prefix",
+ "help": "Set the command prefix used in this channel"})
+@Utils.export("serverset", {"setting": "command-prefix",
+ "help": "Set the command prefix used on this server"})
+@Utils.export("serverset", {"setting": "identity-mechanism",
+ "help": "Set the identity mechanism for this server"})
+class Module(ModuleManager.BaseModule):
@Utils.hook("new.user|channel")
def new(self, event):
if "user" in event: