blob: 9c7433f096411d3733eb61a2009a4782a8f919db [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) => {
Skyler Greyda16adf2023-03-05 10:22:12 +00007 const guild = interaction.guild!;
8 let member = interaction.targetMember;
9 if (!member) member = await guild.members.fetch(interaction.targetId);
10 await userAbout(guild, member as GuildMember, interaction);
11};
PineaFana34d04b2023-01-03 22:05:42 +000012
13const check = async (_interaction: UserContextMenuCommandInteraction) => {
PineaFana34d04b2023-01-03 22:05:42 +000014 return true;
Skyler Greyda16adf2023-03-05 10:22:12 +000015};
PineaFana34d04b2023-01-03 22:05:42 +000016
Skyler Greyda16adf2023-03-05 10:22:12 +000017export { command, callback, check };