diff --git a/modules/define.py b/modules/define.py index 178a9c5a..57b3a762 100644 --- a/modules/define.py +++ b/modules/define.py @@ -1,17 +1,15 @@ #--require-config wordnik-api-key import time -from src import Utils +from src import ModuleManager, Utils URL_WORDNIK = "https://api.wordnik.com/v4/word.json/%s/definitions" URL_WORDNIK_RANDOM = "https://api.wordnik.com/v4/words.json/randomWord" RANDOM_DELAY_SECONDS = 3 -class Module(object): - def __init__(self, bot, events, exports): - self.bot = bot - self._last_called = 0 +class Module(ModuleManager.BaseModule): + _last_called = 0 def _get_definition(self, word): word = event["args"] if "args" in event else event diff --git a/modules/google.py b/modules/google.py index f98ed2ad..fb487db1 100644 --- a/modules/google.py +++ b/modules/google.py @@ -2,15 +2,12 @@ #--require-config google-search-id import json -from src import Utils +from src import ModuleManager, Utils URL_GOOGLESEARCH = "https://www.googleapis.com/customsearch/v1" URL_GOOGLESUGGEST = "http://google.com/complete/search" -class Module(object): - def __init__(self, bot, events, exports): - self.bot = bot - +class Module(ModuleManager.BaseModule): @Utils.hook("received.command.google|g", usage="[search term]") def google(self, event): """ diff --git a/modules/imdb.py b/modules/imdb.py index d735910f..1d3a8ab5 100644 --- a/modules/imdb.py +++ b/modules/imdb.py @@ -1,15 +1,13 @@ #--require-config omdbapi-api-key import json -from src import Utils +from src import ModuleManager, Utils URL_OMDB = "http://www.omdbapi.com/" URL_IMDBTITLE = "http://imdb.com/title/%s" -class Module(object): +class Module(ModuleManager.BaseModule): _name = "IMDb" - def __init__(self, bot, events, exports): - self.bot = bot @Utils.hook("received.command.imdb", min_args=1, usage="") def imdb(self, event): diff --git a/modules/in.py b/modules/in.py index 52363fec..36b84f28 100644 --- a/modules/in.py +++ b/modules/in.py @@ -1,13 +1,10 @@ import time -from src import Utils +from src import ModuleManager, Utils SECONDS_MAX = Utils.SECONDS_WEEKS*8 SECONDS_MAX_DESCRIPTION = "8 weeks" -class Module(object): - def __init__(self, bot, events, exports): - self.bot = bot - +class Module(ModuleManager.BaseModule): @Utils.hook("received.command.in", min_args=2, usage="