aboutsummaryrefslogtreecommitdiff
path: root/src/context-menu-commands/user
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-12-26 17:16:32 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-12-26 17:16:32 -0500
commitfc390ffc300334c396d9d06b0feaf8fbc6ed2814 (patch)
treea6282a74cf99033291ac7bc9de123ae273d528d2 /src/context-menu-commands/user
parent062435590980b87f5b054418ed88604e26358ae9 (diff)
downloadtanzanite-fc390ffc300334c396d9d06b0feaf8fbc6ed2814.tar.gz
tanzanite-fc390ffc300334c396d9d06b0feaf8fbc6ed2814.tar.bz2
tanzanite-fc390ffc300334c396d9d06b0feaf8fbc6ed2814.zip
documentation, bug fixes etc
Diffstat (limited to 'src/context-menu-commands/user')
-rw-r--r--src/context-menu-commands/user/userInfo.ts26
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] });
+ }
+}