(interaction: CommandInteraction | ButtonInteraction, content: string)
| 1 | import { ButtonInteraction, CommandInteraction } from "discord.js"; |
| 2 | |
| 3 | export 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 | } |
no outgoing calls
no test coverage detected