feat: Backport Interaction#isRepliable (#7563)

This commit is contained in:
Jiralite
2022-04-09 10:36:15 +01:00
committed by GitHub
parent 9f09702854
commit 5e8162a137
3 changed files with 37 additions and 0 deletions

View File

@@ -226,6 +226,16 @@ class Interaction extends Base {
MessageComponentTypes[this.componentType] === MessageComponentTypes.SELECT_MENU
);
}
/**
* Indicates whether this interaction can be replied to.
* @returns {boolean}
*/
isRepliable() {
return ![InteractionTypes.PING, InteractionTypes.APPLICATION_COMMAND_AUTOCOMPLETE].includes(
InteractionTypes[this.type],
);
}
}
module.exports = Interaction;