def __init__(self, bot, conf): """ :type bot bot.slack.Bot :param conf configparser.ConfigParser :return: """ Engine.__init__(self, bot, conf) self.bot = bot self.conf = conf self.bot.add_listener(event.message, self.message_listener)
def __init__(self): Engine.__init__(self) # Only one dashboard per process if Dashboard._single: raise Singleton(self) Dashboard._single = self try: self._conf_widgets = Widgets() except Singleton as e: self._conf_widgets = e.get_singleton()
def __init__(self, bot, conf): Engine.__init__(self, bot, conf) self.commandPrefix = conf["command"]["commandPrefix"] self.do_thread = conf["command"]["threading"] # register listener if self.do_thread: print("Enabling threading...") self.threads = [] self.bot.add_listener(event.message, self.create_message_thread) self.bot.wait_for_reply = lambda self, ID=0: True # waiting for reply causes glitches, so we're disabling it else: self.bot.add_listener(event.message, self.on_any_message) # create dict to hold commands self.commands = {} # get permissions engine from bot self.perms = self.bot.enginesSupplied["permission"]
def __init__(self, bot, conf): Engine.__init__(self, bot, conf) self.owners = tuple(x.strip() for x in conf["permission"]["owners"].split(",")) self.ops = tuple(x.strip() for x in conf["permission"]["ops"].split(","))