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) => { |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame] | 7 | console.log("callback"); |
| 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 | }; |
PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 13 | |
| 14 | const check = async (_interaction: UserContextMenuCommandInteraction) => { |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame] | 15 | console.log("check"); |
PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 16 | return true; |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame] | 17 | }; |
PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 18 | |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame] | 19 | export { command, callback, check }; |