Skip to content

Commit

Permalink
feat: allow deletion of ephemeral messages
Browse files Browse the repository at this point in the history
  • Loading branch information
monbrey committed Oct 20, 2022
1 parent b2658ce commit f9f3193
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 5 deletions.
2 changes: 0 additions & 2 deletions packages/discord.js/src/errors/ErrorCodes.js
Expand Up @@ -127,7 +127,6 @@
* @property {'InteractionAlreadyReplied'} InteractionAlreadyReplied
* @property {'InteractionNotReplied'} InteractionNotReplied
* @property {'InteractionEphemeralReplied'} InteractionEphemeralReplied
* @property {'CommandInteractionOptionNotFound'} CommandInteractionOptionNotFound
* @property {'CommandInteractionOptionType'} CommandInteractionOptionType
Expand Down Expand Up @@ -273,7 +272,6 @@ const keys = [

'InteractionAlreadyReplied',
'InteractionNotReplied',
'InteractionEphemeralReplied',

'CommandInteractionOptionNotFound',
'CommandInteractionOptionType',
Expand Down
1 change: 0 additions & 1 deletion packages/discord.js/src/errors/Messages.js
Expand Up @@ -136,7 +136,6 @@ const Messages = {

[DjsErrorCodes.InteractionAlreadyReplied]: 'The reply to this interaction has already been sent or deferred.',
[DjsErrorCodes.InteractionNotReplied]: 'The reply to this interaction has not been sent or deferred.',
[DjsErrorCodes.InteractionEphemeralReplied]: 'Ephemeral responses cannot be deleted.',

[DjsErrorCodes.CommandInteractionOptionNotFound]: name => `Required option "${name}" not found.`,
[DjsErrorCodes.CommandInteractionOptionType]: (name, type, expected) =>
Expand Down
Expand Up @@ -164,7 +164,6 @@ class InteractionResponses {
* .catch(console.error);
*/
async deleteReply() {
if (this.ephemeral) throw new DiscordjsError(ErrorCodes.InteractionEphemeralReplied);
await this.webhook.deleteMessage('@original');
}

Expand Down
1 change: 0 additions & 1 deletion packages/discord.js/typings/index.d.ts
Expand Up @@ -3246,7 +3246,6 @@ export enum DiscordjsErrorCodes {

InteractionAlreadyReplied = 'InteractionAlreadyReplied',
InteractionNotReplied = 'InteractionNotReplied',
InteractionEphemeralReplied = 'InteractionEphemeralReplied',

CommandInteractionOptionNotFound = 'CommandInteractionOptionNotFound',
CommandInteractionOptionType = 'CommandInteractionOptionType',
Expand Down

0 comments on commit f9f3193

Please sign in to comment.