Files
2024-10-26 20:33:18 +08:00

14 lines
390 B
TypeScript

import { ButtonInteraction, CommandInteraction } from "discord.js";
export async function safeReply(interaction: CommandInteraction | ButtonInteraction, content: string) {
try {
if (interaction.deferred || interaction.replied) {
await interaction.followUp(content);
} else {
await interaction.reply(content);
}
} catch (error) {
console.error(error);
}
}