def base_purge(self, ctx: DogbotContext, limit: int, check=None, **kwargs):
# check if it's too much
if limit > 5000:
await ctx.send('Too many messages to purge. 5,000 is the maximum.')
return
# purge the actual command message too
limit += 1
try:
msgs = await ctx.channel.purge(limit=limit, check=check, **kwargs)
await ctx.send(f'Purge complete. Removed {len(msgs)} message(s).', delete_after=2.5)
except discord.NotFound:
pass # ignore not found errors
评论列表
文章目录