示例#1
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleBaguette"
     self.users = userList.UserList()
     self.lines = lines.LinesSeqRnd("modules/resources/bag.txt")
     self.probabilityBag = Probability(self.RATE_BAG)
     self.probabilityNotBag = Probability(self.RATE_NOT_BAG)
示例#2
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleBaguette"
     self.users = userList.UserList()
     self.lines = lines.LinesSeqRnd("modules/resources/bag.txt")
     self.probabilityBag = Probability(self.RATE_BAG)
     self.probabilityNotBag = Probability(self.RATE_NOT_BAG)
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleImageFetcher"
     self.limitator = LimitatorMultiple(
         Limitator(10, 900, True),
         Limitator(120, 60*60, False),
     )
示例#4
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleRandom"
     self.nsfw = Nsfw(self.logger)
     self.images_type = list(
         [i for i in self.nsfw.bonjours.keys() if i != "monsieur"])
     self.bullshit = Bullshit()
示例#5
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "NSFW"
     self.nsfw = Nsfw(self.logger)
     self.limitator = LimitatorMultiple(
         Limitator(5, 60, True),
         Limitator(50, 600, False),
     )
示例#6
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "NSFW"
     self.nsfw = Nsfw(self.logger)
     self.limitator = LimitatorMultiple(
         Limitator(5, 60, True),
         Limitator(50, 600, False),
     )
示例#7
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleAss"
     self.Url = "http://api.obutts.ru/noise/1"
     self.mediaUrl = "http://media.obutts.ru"
     self.limitator = LimitatorMultiple(
         Limitator(5, 60, True),
         Limitator(50, 600, False),
     )
示例#8
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleAss"
     self.Url = "http://api.obutts.ru/noise/1"
     self.mediaUrl = "http://media.obutts.ru"
     self.limitator = LimitatorMultiple(
         Limitator(5, 60, True),
         Limitator(50, 600, False),
     )
示例#9
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleImageFetcher"
     self.limitator = LimitatorMultiple(
         Limitator(10, 900, True),
         Limitator(120, 60 * 60, False),
     )
     provider = DuckDuckGoImagesProvider()
     self.sender = ImageQuerySender(self.bot, provider)
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleImageFetcher"
     self.limitator = LimitatorMultiple(
         Limitator(10, 900, True),
         Limitator(120, 60*60, False),
     )
     provider = DuckDuckGoImagesProvider()
     self.sender = ImageQuerySender(self.bot, provider)
    def insertUser(self, from_attr):

        # Check if username and lastname are not set in Telegram
        if not ModuleBase.checkForAttribute(from_attr, 'username'):
            from_attr['username'] = from_attr['first_name']
        if not ModuleBase.checkForAttribute(from_attr, 'last_name'):
            from_attr['last_name'] = from_attr['first_name']

        # Insert user in DB
        self.cursor.execute('INSERT INTO user (id_user, first_name, last_name, username) VALUES (?,?,?,?)',
                            (from_attr['id'], from_attr['first_name'], from_attr['last_name'], from_attr['username']))

        self.connexion.commit()

        # Add user in listUserID
        self.listUserId.append(from_attr['id'])
示例#12
0
 def __init__(self, bot, name, cmd, provider):
     ModuleBase.__init__(self, bot)
     self.name = name
     self.cmd = cmd
     self.provider = provider
示例#13
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleRandTube"
     self.availableChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW-"
     self.availableNumbers = "1234567890"
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ConversationListener"
     self.listUserId = []
     self.counter = 0
     self.initConnection()
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleWordCounter"
     self.speakers = []
     self.load()
示例#16
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "xkcd"
示例#17
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleBadWords"
     self.bad = bad.Bad("modules/resources/bad.txt")
示例#18
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ConversationListener"
     self.listUserId = []
     self.counter = 0
     self.initConnection()
示例#19
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "xkcd"
示例#20
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleRage"
     self.ragelist = FileList("botTest/ragelist")
示例#21
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleWordCounter"
     self.speakers = []
     self.load()
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleListModule"
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "BestSentences"
     self.best_sentences = BestSentences()
     threading.Thread(target=self.best_sentences.load).start()
示例#24
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleEddyMalou"
示例#25
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "Module9GAG"
示例#26
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleEddyMalou"
示例#27
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleRandShit"
     self.bullshit = Bullshit()
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "BestSentences"
     self.best_sentences = BestSentences()
     threading.Thread(target=self.best_sentences.load).start()
示例#29
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleTroll"
     self.reportedPeople = UserCount(self.NUMBER_REPORT_MESSAGES)
示例#30
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleExplosm"
示例#31
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleSlogan"
     self.lines = lines.LinesSeqRnd("modules/resources/slogans.txt")
示例#32
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleTimeleft"
示例#33
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleTimeleft"
示例#34
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleAdmin"
     self.admin = Admin()
     self.bot.admin = self.admin
示例#35
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleVote"
     self.manager = VoteManager()
示例#36
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleRandTube"
     self.availableChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW-"
     self.availableNumbers = "1234567890"
示例#37
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ChangeGroupName"
示例#38
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleVote"
     self.manager = VoteManager()
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleListModule"
示例#40
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleSlogan"
     self.lines = lines.LinesSeqRnd("modules/resources/slogans.txt")
示例#41
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleAdmin"
     self.admin = Admin()
     self.bot.admin = self.admin
示例#42
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleVersion"
示例#43
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleRandom"
     self.nsfw = Nsfw(self.logger)
     self.images_type = list([i for i in self.nsfw.bonjours.keys() if i != "monsieur"])
     self.bullshit = Bullshit()
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ChangeGroupName"
示例#45
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleRage"
     self.ragelist = FileList("botTest/ragelist")
示例#46
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleVersion"
示例#47
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "Module9GAG"
示例#48
0
 def __init__(self, bot):
     ModuleBase.__init__(self, bot)
     self.name = "ModuleMovieQuote"
 def __init__(self, bot, name, cmd, provider):
     ModuleBase.__init__(self, bot)
     self.name = name
     self.cmd = cmd
     self.provider = provider