I am creating a bot written in python for Discord. I want it to be able to delete specific user's messages, instead of just every message in the text channel. I saw another post on here that helped a bit, but I am having trouble figuring out how to do the 'specific user' part. Here's what I have:
@client.command(pass_context = True)
async def purge(ctx, number):
number = int(number) #Converting the amount of messages to delete to an integer
counter = 0
async for x in client.logs_from(ctx.message.channel, limit = number):
if counter < number:
await client.delete_message(x)
counter += 1