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 | |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame] | 4 | const command = new ContextMenuCommandBuilder().setName("User info"); |
PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 5 | |
| 6 | const callback = async (interaction: UserContextMenuCommandInteraction) => { |
TheCodedProf | c016f9f | 2023-04-23 16:01:38 -0400 | [diff] [blame] | 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 userAbout(guild, member as GuildMember, interaction); |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame] | 11 | }; |
PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 12 | |
| 13 | const check = async (_interaction: UserContextMenuCommandInteraction) => { |
PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 14 | return true; |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame] | 15 | }; |
PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 16 | |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame] | 17 | export { command, callback, check }; |