From 6eb8b1ba6d9aaaf7df42f3d705149f02b6a1b871 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 27 Sep 2018 12:08:07 +0100 Subject: Move all exports to @Utils.export calls --- modules/commands.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'modules/commands.py') 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: -- cgit v1.3.1-10-gc9f91