blob: b2156855b527cc54b01f220257da4dcb48e7c4fc [file] [log] [blame]
PineaFana34d04b2023-01-03 22:05:42 +00001import { ContextMenuCommandBuilder, GuildMember, UserContextMenuCommandInteraction } from "discord.js";
2import { userAbout } from "../../commands/user/about.js";
3
Skyler Greyda16adf2023-03-05 10:22:12 +00004const command = new ContextMenuCommandBuilder().setName("User info");
PineaFana34d04b2023-01-03 22:05:42 +00005
6const callback = async (interaction: UserContextMenuCommandInteraction) => {
TheCodedProf680c4972023-04-23 15:14:08 -04007 try {
8 console.log("getting user info")
9 const guild = interaction.guild!;
10 let member = interaction.targetMember as GuildMember | null;
11 if (!member) member = await guild.members.fetch(interaction.targetId);
12 await userAbout(guild, member as GuildMember, interaction);
13 } catch (e) { console.log(e) }
Skyler Greyda16adf2023-03-05 10:22:12 +000014};
PineaFana34d04b2023-01-03 22:05:42 +000015
16const check = async (_interaction: UserContextMenuCommandInteraction) => {
PineaFana34d04b2023-01-03 22:05:42 +000017 return true;
Skyler Greyda16adf2023-03-05 10:22:12 +000018};
PineaFana34d04b2023-01-03 22:05:42 +000019
Skyler Greyda16adf2023-03-05 10:22:12 +000020export { command, callback, check };