MCPcopy
hub / github.com/codebymitch/TitanBot / universalReply

Method universalReply

src/utils/interactionHelper.js:314–337  ·  view source on GitHub ↗
(interaction, options)

Source from the content-addressed store, hash-verified

312 }
313
314 static async universalReply(interaction, options) {
315 const coordinator = this.getCoordinator(interaction);
316 if (coordinator?.isUsageFinalized()) {
317 return false;
318 }
319
320 if (interaction._isPrefixCommand) {
321 if (coordinator?.hasResponded()) {
322 return await coordinator.edit(sanitizeEditReplyOptions(options));
323 }
324 return await coordinator?.respond(options) ?? this.safeReply(interaction, options);
325 }
326
327 const isReady = await this.ensureReady(interaction, options.flags ? { flags: options.flags } : {});
328 if (!isReady) {
329 return false;
330 }
331
332 if (interaction.deferred) {
333 return await this.safeEditReply(interaction, options);
334 }
335
336 return await this.safeReply(interaction, options);
337 }
338}
339
340export function withSafeExecuteDecorator(target, propertyName, descriptor) {

Callers 2

executeFunction · 0.80
executeFunction · 0.80

Calls 9

getCoordinatorMethod · 0.95
safeReplyMethod · 0.95
ensureReadyMethod · 0.95
safeEditReplyMethod · 0.95
sanitizeEditReplyOptionsFunction · 0.85
isUsageFinalizedMethod · 0.80
hasRespondedMethod · 0.80
editMethod · 0.80
respondMethod · 0.80

Tested by

no test coverage detected