From 3f9d0871b8498671d760edab976a939566fe789c Mon Sep 17 00:00:00 2001 From: baz Date: Sat, 18 Nov 2023 00:03:06 +0000 Subject: [PATCH] Add Avatar command --- commands/testing/avatar.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 commands/testing/avatar.js diff --git a/commands/testing/avatar.js b/commands/testing/avatar.js new file mode 100644 index 0000000..f6384b4 --- /dev/null +++ b/commands/testing/avatar.js @@ -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()}`); + }, +}; \ No newline at end of file