blob: e0578a0cbf5aa600be5b834a83c7eb0e96c963a2 [file] [log] [blame]
Skyler Greyf25451c2023-04-23 21:26:11 +00001import {
2 ContextMenuCommandBuilder,
3 GuildMember,
4 PermissionFlagsBits,
5 UserContextMenuCommandInteraction
6} from "discord.js";
TheCodedProfc016f9f2023-04-23 16:01:38 -04007import { noteMenu } from "../../commands/mod/about.js";
8
Skyler Greyf25451c2023-04-23 21:26:11 +00009const command = new ContextMenuCommandBuilder()
10 .setName("Flag User")
11 .setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages);
TheCodedProfc016f9f2023-04-23 16:01:38 -040012
13const callback = async (interaction: UserContextMenuCommandInteraction) => {
14 const guild = interaction.guild!;
15 let member = interaction.targetMember as GuildMember | null;
16 if (!member) member = await guild.members.fetch(interaction.targetId);
17 await noteMenu(member, interaction);
18};
19
20const check = async (_interaction: UserContextMenuCommandInteraction) => {
21 return true;
22};
23
24export { command, callback, check };