PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 1 | import { ContextMenuCommandBuilder, GuildMember, UserContextMenuCommandInteraction } from "discord.js"; |
| 2 | import { userAbout } from "../../commands/user/about.js"; |
| 3 | |
| 4 | const command = new ContextMenuCommandBuilder() |
| 5 | .setName("User info") |
| 6 | |
| 7 | const callback = async (interaction: UserContextMenuCommandInteraction) => { |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 8 | console.log("callback") |
PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 9 | const guild = interaction.guild! |
| 10 | let member = interaction.targetMember |
| 11 | if (!member) member = await guild.members.fetch(interaction.targetId) |
| 12 | await userAbout(guild, member as GuildMember, interaction) |
| 13 | } |
| 14 | |
| 15 | const check = async (_interaction: UserContextMenuCommandInteraction) => { |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 16 | console.log("check") |
PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 17 | return true; |
| 18 | } |
| 19 | |
| 20 | export { command, callback, check } |