Commando icon indicating copy to clipboard operation
Commando copied to clipboard

Deleting command message

Open katlyn opened this issue 8 years ago • 13 comments

Something that I have seen the need of in some of my bots is deleting the messages that initiated a command. An option that allows for the message the initiated a command to be deleted. This includes the helper messages for arguments. I can delete the very first message that the user sends, but if any helper messages are sent by the bot asking for arguments, there is no way (that I know of) that you can delete them and the responses from the user.

katlyn avatar Sep 13 '17 01:09 katlyn

https://discord.js.org/#/docs/commando/master/class/CommandMessage?scrollTo=responses

Gawdl3y avatar Sep 27 '17 19:09 Gawdl3y

Actually, that may not be it. I'll have to check later.

Gawdl3y avatar Sep 27 '17 19:09 Gawdl3y

Agreed, that would be a nice-to-have.

Telokis avatar Feb 11 '18 20:02 Telokis

+1, really need to delete the messages in the argument asking process

Armaldio avatar Jun 19 '18 20:06 Armaldio

Any update on this 😞?

ghost avatar Sep 01 '18 22:09 ghost

Yeah thats a really need option to delete the prompts and response messages

Vanthenos avatar Feb 17 '19 14:02 Vanthenos

Currently, it can be accomplished by deleting messages in the CommandoMessage#responses property in the CommandoClient#commandRun event after a delay. A more graceful way of handling this is planned.

Gawdl3y avatar Feb 21 '19 04:02 Gawdl3y

Is it possible to delete more messages in a single channel?

BalmaBrian avatar Apr 18 '20 00:04 BalmaBrian

Is it possible to delete more messages in a single channel?

If I understand correctly, isn't that what bulkDelete is for?

Naim2000 avatar Apr 18 '20 00:04 Naim2000

@Naim2000 yes, how ever I am still having trouble using the this.client functionality to access bulkDelete correctly. I am probably approaching this problem incorrectly. Is there a way to use bulkDelete in a run function of a Command class?

BalmaBrian avatar Apr 18 '20 04:04 BalmaBrian

@BalmaBrian The bulkDelete function exists on the TextChannel class and has nothing to do with the client. See this page for more information. Otherwise, feel free to take your Discord.js-related questions to the support channels within the official Discord server - https://discord.gg/bRCvFy9

Fyko avatar Apr 18 '20 04:04 Fyko

Is there any update on this issue/enhancement? Deleting arg prompts is still a problematic experience

Kaper365 avatar Jul 30 '21 09:07 Kaper365

Currently, it can be accomplished by deleting messages in the CommandoMessage#responses property in the CommandoClient#commandRun event after a delay. A more graceful way of handling this is planned.

How do you do that? When I use message.responses I have no options to delete available, VS Code tells me the type is {}.

Akhronox avatar Nov 13 '21 11:11 Akhronox