Skip to content

Commit 28a552c

Browse files
author
Florian Kaiser
committed
fix: Respond to interaction when using purge command
1 parent 4ec07b0 commit 28a552c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cogs/moderation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,11 @@ async def purge(self, context: Context, amount: int) -> None:
270270
:param context: The hybrid command context.
271271
:param amount: The number of messages that should be deleted.
272272
"""
273-
purged_messages = await context.channel.purge(limit=amount)
273+
await context.send("Deleting messages...") # Bit of a hacky way to make sure the bot responds to the interaction and doens't get a "Unknown Interaction" response
274+
purged_messages = await context.channel.purge(limit=amount+1)
274275
embed = discord.Embed(
275276
title="Chat Cleared!",
276-
description=f"**{context.author}** cleared **{len(purged_messages)}** messages!",
277+
description=f"**{context.author}** cleared **{len(purged_messages-1)}** messages!",
277278
color=0x9C84EF
278279
)
279280
await context.channel.send(embed=embed)

0 commit comments

Comments
 (0)