(interaction)
| 74 | } |
| 75 | |
| 76 | static isInteractionValid(interaction) { |
| 77 | if (!interaction || typeof interaction !== 'object') return false; |
| 78 | if (!interaction.id || typeof interaction.id !== 'string') return false; |
| 79 | |
| 80 | if (!interaction.user || typeof interaction.user !== 'object') return false; |
| 81 | |
| 82 | if (interaction.createdTimestamp && (Date.now() - interaction.createdTimestamp) > INTERACTION_TIMEOUT_MS) { |
| 83 | return false; |
| 84 | } |
| 85 | |
| 86 | return true; |
| 87 | } |
| 88 | |
| 89 | static async ensureReady(interaction, deferOptions = { flags: MessageFlags.Ephemeral }) { |
| 90 | if (!this.isInteractionValid(interaction)) { |
no outgoing calls
no test coverage detected