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 24, 2022
1 parent b2658ce commit 5e29df0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/discord.js/src/errors/ErrorCodes.js
Expand Up @@ -128,6 +128,7 @@
* @property {'InteractionAlreadyReplied'} InteractionAlreadyReplied
* @property {'InteractionNotReplied'} InteractionNotReplied
* @property {'InteractionEphemeralReplied'} InteractionEphemeralReplied
* <warn>This property is deprecated.</warn>
* @property {'CommandInteractionOptionNotFound'} CommandInteractionOptionNotFound
* @property {'CommandInteractionOptionType'} CommandInteractionOptionType
Expand Down Expand Up @@ -273,7 +274,6 @@ const keys = [

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

'CommandInteractionOptionNotFound',
'CommandInteractionOptionType',
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: 1 addition & 0 deletions packages/discord.js/typings/index.d.ts
Expand Up @@ -3246,6 +3246,7 @@ export enum DiscordjsErrorCodes {

InteractionAlreadyReplied = 'InteractionAlreadyReplied',
InteractionNotReplied = 'InteractionNotReplied',
/** @deprecated */
InteractionEphemeralReplied = 'InteractionEphemeralReplied',

CommandInteractionOptionNotFound = 'CommandInteractionOptionNotFound',
Expand Down

0 comments on commit 5e29df0

Please sign in to comment.