botcollection.py 文件源码

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

项目:jose 作者: lnmds 项目源码 文件源码
def on_member_join(self, member):
        guild = member.guild

        if guild.id in WHITELIST:
            return

        bots, humans, ratio = self.bot_human_ratio(guild)
        bot_ratio = await self.guild_ratio(guild)

        if ratio > bot_ratio:
            log.info(f'[bh:leave:member_join] leaving {guild!r} {guild.id},'
                     f' {ratio} ({len(bots)} / {len(humans)}) > {bot_ratio}')
            try:
                await guild.owner.send('Your guild was classified as a bot'
                                       'collection, josé automatically left.'
                                       f'{len(bots)} bots, {len(humans)} humans, '
                                       f'{ratio}b/h, ratio is over {BOT_RATIO_MAX}')
            except discord.HTTPException:
                pass
            await guild.leave()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号