MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / isInteractionValid

Method isInteractionValid

src/utils/interactionHelper.js:76–87  ·  view source on GitHub ↗
(interaction)

Source from the content-addressed store, hash-verified

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)) {

Callers 7

ensureReadyMethod · 0.95
safeDeferMethod · 0.95
safeEditReplyMethod · 0.95
safeReplyMethod · 0.95
safeShowModalMethod · 0.95
safeExecuteMethod · 0.95
executeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected