mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
feat: allow deletion of ephemeral messages (#8774)
* feat: allow deletion of ephemeral messages * fix: restore missing key Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -128,6 +128,7 @@
|
|||||||
* @property {'InteractionAlreadyReplied'} InteractionAlreadyReplied
|
* @property {'InteractionAlreadyReplied'} InteractionAlreadyReplied
|
||||||
* @property {'InteractionNotReplied'} InteractionNotReplied
|
* @property {'InteractionNotReplied'} InteractionNotReplied
|
||||||
* @property {'InteractionEphemeralReplied'} InteractionEphemeralReplied
|
* @property {'InteractionEphemeralReplied'} InteractionEphemeralReplied
|
||||||
|
* <warn>This property is deprecated.</warn>
|
||||||
|
|
||||||
* @property {'CommandInteractionOptionNotFound'} CommandInteractionOptionNotFound
|
* @property {'CommandInteractionOptionNotFound'} CommandInteractionOptionNotFound
|
||||||
* @property {'CommandInteractionOptionType'} CommandInteractionOptionType
|
* @property {'CommandInteractionOptionType'} CommandInteractionOptionType
|
||||||
|
|||||||
@@ -164,7 +164,6 @@ class InteractionResponses {
|
|||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
async deleteReply() {
|
async deleteReply() {
|
||||||
if (this.ephemeral) throw new DiscordjsError(ErrorCodes.InteractionEphemeralReplied);
|
|
||||||
await this.webhook.deleteMessage('@original');
|
await this.webhook.deleteMessage('@original');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -3246,6 +3246,7 @@ export enum DiscordjsErrorCodes {
|
|||||||
|
|
||||||
InteractionAlreadyReplied = 'InteractionAlreadyReplied',
|
InteractionAlreadyReplied = 'InteractionAlreadyReplied',
|
||||||
InteractionNotReplied = 'InteractionNotReplied',
|
InteractionNotReplied = 'InteractionNotReplied',
|
||||||
|
/** @deprecated */
|
||||||
InteractionEphemeralReplied = 'InteractionEphemeralReplied',
|
InteractionEphemeralReplied = 'InteractionEphemeralReplied',
|
||||||
|
|
||||||
CommandInteractionOptionNotFound = 'CommandInteractionOptionNotFound',
|
CommandInteractionOptionNotFound = 'CommandInteractionOptionNotFound',
|
||||||
|
|||||||
Reference in New Issue
Block a user