Records context menu command
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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] });
|
||||
}
|
||||
Reference in New Issue
Block a user