diff options
Diffstat (limited to 'src/context-menu-commands/user')
-rw-r--r-- | src/context-menu-commands/user/userInfo.ts | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/context-menu-commands/user/userInfo.ts b/src/context-menu-commands/user/userInfo.ts index 2ab265a..1e35093 100644 --- a/src/context-menu-commands/user/userInfo.ts +++ b/src/context-menu-commands/user/userInfo.ts @@ -1 +1,25 @@ -// todo: make context interaction for user command +import { BushGuild, BushGuildMember, BushUser } from '#lib'; +import { ContextMenuCommand } from 'discord-akairo'; +import { type ContextMenuInteraction } from 'discord.js'; +import UserInfoCommand from '../../commands/info/userInfo.js'; + +export default class UserInfoContextMenuCommand extends ContextMenuCommand { + public constructor() { + super('userInfo', { + name: 'User Info', + type: 'USER', + category: 'user' + }); + } + + public override async exec(interaction: ContextMenuInteraction) { + await interaction.deferReply({ ephemeral: true }); + + const user = (await interaction.user.fetch()) as BushUser; + const member = interaction.member as BushGuildMember; + const guild = interaction.guild as BushGuild; + const userEmbed = await UserInfoCommand.makeUserInfoEmbed(user, member, guild); + + return await interaction.editReply({ embeds: [userEmbed] }); + } +} |