bot.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:blacklion 作者: Foohx 项目源码 文件源码
def _fncChatBotAlly_cmdWhoPlays(self, m):
        self.log("+", "\t\tReceive command !who_plays")
        table = self.db['ranks'].table('server_'+str(self.account.account['serveur']))

        # scan_date = table.get(where('id'), len(table))
        # scan_date = scan_date['scan_date']

        ranks_old = table.all()
        ranks_now = self.account.getRanking()
        self.log("?", "\t\tSearching for actives users..")
        rapport = "Active players for last 5 days :\n\n"
        count = 0
        for rn in ranks_now:
            for ro in ranks_old:
                if rn['user'] == ro['user']:
                    if (ro['points'] - rn['points']) != 0:
                        count = count +1
                        rapport = rapport + "- @" + rn['user'] + " ("+str((rn['points'] - ro['points']))+" pts)\n"
                    if count >= 7:
                        count = 0
                        self.account.rSendMessageToAlliance(rapport)
                        rapport = ""
                    break
        rapport = rapport + "OVER !"
        self.account.rSendMessageToAlliance(rapport)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号