TheCodedProf | c016f9f | 2023-04-23 16:01:38 -0400 | [diff] [blame^] | 1 | import { ContextMenuCommandBuilder, GuildMember, PermissionFlagsBits, UserContextMenuCommandInteraction } from "discord.js"; |
| 2 | import { noteMenu } from "../../commands/mod/about.js"; |
| 3 | |
| 4 | const command = new ContextMenuCommandBuilder().setName("Flag User").setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages); |
| 5 | |
| 6 | const callback = async (interaction: UserContextMenuCommandInteraction) => { |
| 7 | const guild = interaction.guild!; |
| 8 | let member = interaction.targetMember as GuildMember | null; |
| 9 | if (!member) member = await guild.members.fetch(interaction.targetId); |
| 10 | await noteMenu(member, interaction); |
| 11 | }; |
| 12 | |
| 13 | const check = async (_interaction: UserContextMenuCommandInteraction) => { |
| 14 | return true; |
| 15 | }; |
| 16 | |
| 17 | export { command, callback, check }; |