aboutsummaryrefslogtreecommitdiff
path: root/bot/src/commands/userinfo.js
diff options
context:
space:
mode:
authorAndrew Lee <andrew@alee14.me>2025-03-04 10:05:14 -0500
committerAndrew Lee <andrew@alee14.me>2025-03-04 10:05:14 -0500
commitcc06b8ed4e4e0aef02dfd8ab15df22a57a177a0a (patch)
treedeffb57bee9fe24a8d1b8143fba603774544ee00 /bot/src/commands/userinfo.js
parent11bb9ab6b30314d91209bc9888d95783cc247e98 (diff)
downloadAleeBot-cc06b8ed4e4e0aef02dfd8ab15df22a57a177a0a.tar.gz
AleeBot-cc06b8ed4e4e0aef02dfd8ab15df22a57a177a0a.tar.bz2
AleeBot-cc06b8ed4e4e0aef02dfd8ab15df22a57a177a0a.zip
Readme change; Docker; Logging
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] });