blob: e6af8367aa664314ff0dbb4c7cce7b499582d2cd [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) => {
TheCodedProfc016f9f2023-04-23 16:01:38 -04007 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 Greyda16adf2023-03-05 10:22:12 +000011};
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 };