Answer the question
In order to leave comments, you need to log in
How to delete messages of a specific user?
There is such a function:
async def clr(self, ctx, member: discord.User, *, amount = 100):
await ctx.message.delete()
await ctx.channel.purge(limit = amount, check = lambda message: message.author == member)
Answer the question
In order to leave comments, you need to log in
async def remove_messages(ctx, author, count):
total_messages = 0
author_messages = 0
async for message in channel.history(limit=None):
total_messages += 1
if message.author == author:
author_messages += 1
if author_messages == count:
break
await ctx.channel.purge(limit = total_messages, check = lambda message: message.author == member)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question