Skyler Grey | f25451c | 2023-04-23 21:26:11 +0000 | [diff] [blame^] | 1 | import { |
| 2 | ContextMenuCommandBuilder, |
| 3 | GuildMember, |
| 4 | PermissionFlagsBits, |
| 5 | UserContextMenuCommandInteraction |
| 6 | } from "discord.js"; |
TheCodedProf | c016f9f | 2023-04-23 16:01:38 -0400 | [diff] [blame] | 7 | import { noteMenu } from "../../commands/mod/about.js"; |
| 8 | |
Skyler Grey | f25451c | 2023-04-23 21:26:11 +0000 | [diff] [blame^] | 9 | const command = new ContextMenuCommandBuilder() |
| 10 | .setName("Flag User") |
| 11 | .setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages); |
TheCodedProf | c016f9f | 2023-04-23 16:01:38 -0400 | [diff] [blame] | 12 | |
| 13 | const 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 | |
| 20 | const check = async (_interaction: UserContextMenuCommandInteraction) => { |
| 21 | return true; |
| 22 | }; |
| 23 | |
| 24 | export { command, callback, check }; |