Ejemplo n.º 1
0
 def __init__(self,
              bot,
              desc,
              command,
              pm_allowed=True,
              lock_time=0,
              delay=0):
     AsyncModule.__init__(self, bot, command, desc, delay)
     SyncModule.__init__(self, bot, desc, command, pm_allowed, lock_time)
     self._mute = True
Ejemplo n.º 2
0
    def __init__(self, bot):
        AsyncModule.__init__(self,
                             bot,
                             name="twitter",
                             desc="Displays tweets",
                             delay=60)

        for user in self.users:
            if not self.bot.session.query(LastTweets).filter(LastTweets.user == user).first():
                self.bot.session.add(LastTweets(user=user, last=0))
                self.bot.session.commit()

        token = Twython(self.app_key, self.app_secret, oauth_version=2).obtain_access_token()
        self.twitter = Twython(self.app_key, access_token=token)
Ejemplo n.º 3
0
    def __init__(self, bot):
        AsyncModule.__init__(self, 
                             bot,  
                             name = "mail",
                             desc = "Displaying incoming mails",
                             delay = 0)
        f = open(MAILFILE, "w")
        f.write('')
        f.close()

        self.file = open(MAILFILE) 
        self.msubject = ""
        self.mfrom=""
        self.spam = -1
Ejemplo n.º 4
0
    def __init__(self, bot):
        AsyncModule.__init__(self,
                             bot,
                             name="mail",
                             desc="Displaying incoming mails",
                             delay=0)

        if self.format == "mbox":
            self.notifier = mbox.MboxNotify(bot, self.path)
        elif self.format == "mdir":
            self.notifier = mdir.MdirNotify(bot, self.path)
        elif self.format != "":
            self.alive = False
            logger.error(u"Mail box format « %s » not defined. You must use either mbox or mdir !" % self.format)
        elif self.format == "":
            self.delay = 10
Ejemplo n.º 5
0
    def __init__(self, bot):
        AsyncModule.__init__(self,
                             bot,
                             name="mail",
                             desc="Displaying incoming mails",
                             delay=0)

        if self.format == "mbox":
            self.notifier = mbox.MboxNotify(bot, self.path)
        elif self.format == "mdir":
            self.notifier = mdir.MdirNotify(bot, self.path)
        elif self.format != "":
            self.alive = False
            logger.error(
                u"Mail box format « %s » not defined. You must use either mbox or mdir !"
                % self.format)
        elif self.format == "":
            self.delay = 10
Ejemplo n.º 6
0
    def __init__(self, bot):
        AsyncModule.__init__(self,
                             bot,
                             name="twitter",
                             desc="Displays tweets",
                             delay=60)

        for user in self.users:
            last = self.bot.session.query(LastTweets).order_by(LastTweets.last.desc()).first()
            last_id = last.last if last is not None else 0
            if not self.bot.session.query(LastTweets).filter(LastTweets.user == user).first():
                self.bot.session.add(LastTweets(user=user, last=last_id))
                self.bot.session.commit()

        token = Twython(self.app_key, self.app_secret, oauth_version=2).obtain_access_token()
        self.twitter = Twython(self.app_key, access_token=token)
        self.err = False
        if self.shy_start:
            self.action(say=False)
Ejemplo n.º 7
0
    def __init__(self, bot):
        AsyncModule.__init__(self,
                             bot,
                             name="twitter",
                             desc="Displays tweets",
                             delay=60)

        for user in self.users:
            last = self.bot.session.query(LastTweets).order_by(
                LastTweets.last.desc()).first()
            last_id = last.last if last is not None else 0
            if not self.bot.session.query(LastTweets).filter(
                    LastTweets.user == user).first():
                self.bot.session.add(LastTweets(user=user, last=last_id))
                self.bot.session.commit()

        token = Twython(self.app_key, self.app_secret,
                        oauth_version=2).obtain_access_token()
        self.twitter = Twython(self.app_key, access_token=token)
        self.err = 0
        if self.shy_start:
            self.action(say=False)
Ejemplo n.º 8
0
 def __init__(self, bot, desc, command, pm_allowed=True, lock_time=0, delay=0):
     AsyncModule.__init__(self, bot, command, desc, delay, pm_allowed)
     SyncModule.__init__(self, bot, desc, command, pm_allowed, lock_time)
     self.mute = False
Ejemplo n.º 9
0
 def __init__(self, bot, desc, name,
              pm_allowed=True, lock_time=0, delay=0):
     AsyncModule.__init__(self, bot, name, desc, delay)
     SyncModule.__init__(self, bot, desc, name, pm_allowed, lock_time)
     self._mute = True