Add Avatar command

This commit is contained in:
baz 2023-11-18 00:03:06 +00:00
parent 8d1d93ad3f
commit 3f9d0871b8
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('avatar')
.setDescription('Get the avatar URL of the selected user, or your own avatar.')
.addUserOption(option => option.setName('user').setDescription('The user\'s avatar to show')),
async execute(interaction) {
const user = interaction.options.getUser('user');
if (user) return interaction.reply(`${user.username}'s avatar: ${user.displayAvatarURL()}`);
return interaction.reply(`Your avatar: ${interaction.user.displayAvatarURL()}`);
},
};