Skip to content

Commit

Permalink
feat: allow deletion of ephemeral messages (#8774)
Browse files Browse the repository at this point in the history
* feat: allow deletion of ephemeral messages

* fix: restore missing key

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
monbrey and kodiakhq[bot] authored Oct 27, 2022
1 parent 68d5712 commit fc10774
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/discord.js/src/errors/ErrorCodes.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -3246,6 +3246,7 @@ export enum DiscordjsErrorCodes {

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

CommandInteractionOptionNotFound = 'CommandInteractionOptionNotFound',
Expand Down

0 comments on commit fc10774

Please sign in to comment.