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()
评论列表
文章目录