if user and amount:
embed = discord.Embed(title="Clear | Loading...",
description=f"Deleting {amount} messages from user {user.mention} in Channel.",
color=0xD5B815)
embed.set_footer(text=f"Aromic4All | /discord")
await ctx.respond(embed=embed, ephemeral=True)
async for message in ctx.channel.history(limit=1000):
if message_amount == amount:
break
if message.author == user:
await message.delete()
message_amount += 1
embed = discord.Embed(title="Clear | SUCCESSFULLY",
description=f"You have successfully cleared {message_amount}/{amount} message(s) from user {user.mention}.",
color=0x6915D5)
embed.set_footer(text=f"Aromic4All | /discord")
await ctx.send(embed=embed, delete_after=3)
elif amount:
embed = discord.Embed(title="Clear | Loading...",
description=f"Deleting {amount} messages in Channel.",
color=0xD5B815)
embed.set_footer(text=f"Aromic4All | /discord")
await ctx.respond(embed=embed, ephemeral=True)
async for message in ctx.channel.history(limit=amount):
await message.delete()
message_amount += 1
embed = discord.Embed(title="Clear | SUCCESSFULLY",
description=f"You have successfully cleared {message_amount}/{amount} message(s).",
color=0x6915D5)
embed.set_footer(text=f"Aromic4All | /discord")
await ctx.send(embed=embed, delete_after=3)
elif user:
embed = discord.Embed(title="Clear | Loading...",
description=f"Deleting 100 messages from user {user.mention} in Channel.",
color=0xD5B815)
embed.set_footer(text=f"Aromic4All | /discord")
await ctx.respond(embed=embed, ephemeral=True)
async for message in ctx.channel.history(limit=200):
if message_amount == 100:
break
if message.author == user:
await message.delete()
message_amount += 1
I only have the problem that the messages are cleared individually and that is too slow. I want that all messages are cleared immediately at once, can help me there who?