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) => { |
| 8 | const guild = interaction.guild! |
| 9 | let member = interaction.targetMember |
| 10 | if (!member) member = await guild.members.fetch(interaction.targetId) |
| 11 | await userAbout(guild, member as GuildMember, interaction) |
| 12 | } |
| 13 | |
| 14 | const check = async (_interaction: UserContextMenuCommandInteraction) => { |
| 15 | return true; |
| 16 | } |
| 17 | |
| 18 | export { command, callback, check } |