From 9470f873d281deb168b2b397f9a8f7211671be45 Mon Sep 17 00:00:00 2001 From: Ruyme404 Date: Thu, 5 May 2022 19:59:40 +0300 Subject: [PATCH 1/2] Added /avatar command Added / avatar command that displays someone's avatar. --- commands/1. General/avatar.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 commands/1. General/avatar.js diff --git a/commands/1. General/avatar.js b/commands/1. General/avatar.js new file mode 100644 index 0000000..f3bc215 --- /dev/null +++ b/commands/1. General/avatar.js @@ -0,0 +1,20 @@ +import { SlashCommandBuilder } from '@discordjs/builders' +import { MessageEmbed } from 'discord.js' + +export const { data, execute } = { + data: new SlashCommandBuilder() + .setName('avatar') + .setDescription('Send\'s specified user\'s avatar.') + .addMentionableOption((option) => option.setName('user').setDescription('The user to get the avatar from').setRequired(true)), + async execute(interaction) { + + const user = interaction.options.getMentionable('user') + + const embed = new MessageEmbed() + .setAuthor({ name: 'avatar', iconURL: interaction.member.user.displayAvatarURL() }) + .setTitle(`${user.user.username}'s avatar`) + .setImage(user.user.displayAvatarURL()) + .setFooter({ text: 'SuitBot', iconURL: interaction.client.user.displayAvatarURL() }) + await interaction.reply({ embeds: [embed] }) + } +} \ No newline at end of file From b4819b1e6f792577c192d653a06a198881019ee5 Mon Sep 17 00:00:00 2001 From: Sprisa <62175943+karkkijokeri@users.noreply.github.com> Date: Fri, 6 May 2022 01:03:26 +0300 Subject: [PATCH 2/2] Update avatar.js --- commands/1. General/avatar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/1. General/avatar.js b/commands/1. General/avatar.js index f3bc215..3b3088f 100644 --- a/commands/1. General/avatar.js +++ b/commands/1. General/avatar.js @@ -13,8 +13,8 @@ export const { data, execute } = { const embed = new MessageEmbed() .setAuthor({ name: 'avatar', iconURL: interaction.member.user.displayAvatarURL() }) .setTitle(`${user.user.username}'s avatar`) - .setImage(user.user.displayAvatarURL()) + .setImage(user.user.displayAvatarURL()) .setFooter({ text: 'SuitBot', iconURL: interaction.client.user.displayAvatarURL() }) await interaction.reply({ embeds: [embed] }) } -} \ No newline at end of file +}