From fc390ffc300334c396d9d06b0feaf8fbc6ed2814 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sun, 26 Dec 2021 17:16:32 -0500 Subject: documentation, bug fixes etc --- src/context-menu-commands/user/userInfo.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/context-menu-commands') 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] }); + } +} -- cgit