Records context menu command

This commit is contained in:
Tarrgon
2025-06-01 08:35:55 -04:00
parent cec8449b6d
commit 9622795935
6 changed files with 39 additions and 15 deletions
+1
View File
@@ -4,6 +4,7 @@ export * from './audit-log-utils';
export * from './channel-utils';
export * from './commands';
export * from './e621-utils';
export * from './interaction-utils';
export * from './message-logger';
export * from './message-utils';
export * from './ms-to-human';
+9
View File
@@ -0,0 +1,9 @@
import { ChatInputCommandInteraction, ContextMenuCommandInteraction, GuildBasedChannel, MessageFlags } from 'discord.js';
import { channelIsInStaffCategory } from './channel-utils';
export async function deferInteraction(interaction: ChatInputCommandInteraction | ContextMenuCommandInteraction) {
const isStaffChannel = await channelIsInStaffCategory(interaction.channel as GuildBasedChannel);
if (isStaffChannel) await interaction.deferReply();
else await interaction.deferReply({ flags: [MessageFlags.Ephemeral] });
}