Answer the question
In order to leave comments, you need to log in
I took the clear command from a random site, and the command clears the entire channel, why?
I took the 'clear' command code from the website random, I tested it, and the whole channel was cleared
@bot.command()
async def clear(ctx, amount=None):
await ctx.channel.purge(limit=int(500))
await ctx.channel.send(':: Сообщения успешно удалены')
Answer the question
In order to leave comments, you need to log in
Line
Change to:
await ctx.channel.purge(limit=int(500))
await ctx.channel.purge(limit = 1) # для удаления сообщения которое вызывает команду
deleted = await ctx.message.channel.purge(limit=amount) #само удаление сообщений.
cleared the whole channel
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question