def _bots(self, ctx, amount: int=100):
"""Clears bots and bot calls."""
def check(m):
if m.author.bot:
return True
for mem in m.mentions:
if mem.bot:
return True
if m.content.startswith(tuple(i for i in string.punctuation)) and not bool(re.search(r'^<@!?(\d+)>', m.content)):
return True
return False
messages = await self.bot.purge_from(ctx.message.channel, limit=amount, before=ctx.message, check=check)
await self.bot.delete_message(ctx.message)
send = await self.bot.say("Successfully cleared **{}** messages".format(len(messages)))
await asyncio.sleep(3)
await self.bot.delete_message(send)
评论列表
文章目录