aboutsummaryrefslogtreecommitdiff
path: root/bot/src/commands/userinfo.js
diff options
context:
space:
mode:
Diffstat (limited to 'bot/src/commands/userinfo.js')
-rw-r--r--bot/src/commands/userinfo.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/bot/src/commands/userinfo.js b/bot/src/commands/userinfo.js
index b51ef0a..c079661 100644
--- a/bot/src/commands/userinfo.js
+++ b/bot/src/commands/userinfo.js
@@ -4,16 +4,22 @@ import { abEmbedColour } from '../storage/consts.js';
export default {
data: new SlashCommandBuilder()
.setName('userinfo')
- .setDescription('Information about a user.'),
+ .setDescription('Information about a user.')
+ .addUserOption(option =>
+ option
+ .setName('username')
+ .setDescription('The user to get the information of')),
async execute(interaction) {
+ const username = interaction.options.getUser('username') || interaction.user;
+ const member = interaction.guild.members.cache.get(username.id);
const userEmbed = new EmbedBuilder()
- .setAuthor({ name: interaction.user.tag, iconURL: interaction.user.avatarURL() })
+ .setAuthor({ name: username.tag, iconURL: username.avatarURL() })
.setDescription('User Information')
- .setThumbnail(interaction.user.avatarURL())
+ .setThumbnail(username.avatarURL())
.addFields(
- { name: 'Names', value: `**Display Name:** ${interaction.member.displayName}\n**Username:** ${interaction.user.username}`},
- { name: 'Identity', value: `**User ID:** ${interaction.user.id}` },
- { name: 'Create and Join Times', value: `**Created At:** ${interaction.member.user.createdAt.toUTCString()}\n**Joined Guild At:** ${interaction.member.joinedAt.toUTCString()}`}
+ { name: 'Names', value: `**Display Name:** ${member.displayName}\n**Username:** ${username.username}`},
+ { name: 'Identity', value: `**User ID:** ${username.id}` },
+ { name: 'Create and Join Times', value: `**Created At:** ${username.createdAt.toUTCString()}\n**Joined Guild At:** ${member.joinedAt.toUTCString()}`}
)
.setColor(abEmbedColour);
return await interaction.reply({ embeds: [userEmbed] });