MCPcopy
hub / github.com/eritislami/evobot / safeReply

Function safeReply

utils/safeReply.ts:3–13  ·  view source on GitHub ↗
(interaction: CommandInteraction | ButtonInteraction, content: string)

Source from the content-addressed store, hash-verified

1import { ButtonInteraction, CommandInteraction } from "discord.js";
2
3export async function safeReply(interaction: CommandInteraction | ButtonInteraction, content: string) {
4 try {
5 if (interaction.deferred || interaction.replied) {
6 await interaction.followUp(content);
7 } else {
8 await interaction.reply(content);
9 }
10 } catch (error) {
11 console.error(error);
12 }
13}

Callers 9

executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
executeFunction · 0.90
handleMuteMethod · 0.90
handleDecreaseVolumeMethod · 0.90
handleIncreaseVolumeMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected