(interaction, deferOptions = { flags: MessageFlags.Ephemeral })
| 87 | } |
| 88 | |
| 89 | static async ensureReady(interaction, deferOptions = { flags: MessageFlags.Ephemeral }) { |
| 90 | if (!this.isInteractionValid(interaction)) { |
| 91 | return false; |
| 92 | } |
| 93 | |
| 94 | if (interaction.replied || interaction.deferred) { |
| 95 | return true; |
| 96 | } |
| 97 | |
| 98 | if (interaction._isPrefixCommand) { |
| 99 | const coordinator = this.getCoordinator(interaction) || ResponseCoordinator.attach(interaction); |
| 100 | return coordinator.deferLocal(); |
| 101 | } |
| 102 | |
| 103 | return await this.safeDefer(interaction, deferOptions); |
| 104 | } |
| 105 | |
| 106 | static async safeDefer(interaction, options = {}) { |
| 107 | try { |
no test coverage detected