Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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()
Ejemplo n.º 3
0
    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"]
Ejemplo n.º 4
0
    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"]
Ejemplo n.º 5
0
 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(","))
Ejemplo n.º 6
0
 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(","))