Answer the question
In order to leave comments, you need to log in
How can I prevent a bot from deleting the last messages in 24 hours when a user is banned?
Here's the ban code just in case:
@bot.command()
@commands.has_any_role(00000000000000000000000)
async def ban( ctx, member: discord.Member, *, reason = None):
await member.ban( reason = reason )
await ctx.send ( f'{member.mention} был забанен на сервере. Причина: {reason}.')
Answer the question
In order to leave comments, you need to log in
Let's look at the documentation for Member.ban again:
We see that Member.ban is equal to Guild.ban , and go to the documentation for Guild.ban, and notice that there is a kwarg delete_message_days
, just equal to 1 by default:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question