Add ModuleManager.BaseModule so modules don't *have* to implement __init__

This commit is contained in:
jesopo 2018-09-19 13:28:18 +01:00
parent fcbb7c960c
commit 287d031281
2 changed files with 6 additions and 5 deletions

View file

@ -2,6 +2,10 @@ import glob, imp, inspect, os, sys, uuid
BITBOT_HOOKS_MAGIC = "__bitbot_hooks"
class BaseModule(object):
def __init__(self, bot, events, exports):
pass
class ModuleManager(object):
def __init__(self, bot, events, exports, directory="modules"):
self.bot = bot

View file

@ -1,9 +1,6 @@
import Utils
class Module(object):
def __init__(self, bot, events, exports):
pass
import ModuleManager, Utils
class Module(ModuleManager.BaseModule):
@Utils.hook("received.command.ping", help="Ping pong!")
def pong(self, event):
event["stdout"].write("Pong!")