From 2c0f83e9d8997c221bc081b429bb679980ed5f47 Mon Sep 17 00:00:00 2001 From: Minz Date: Mon, 4 Mar 2024 14:28:04 +0100 Subject: [PATCH] Add set_avatar command --- commands/utility/setAvatar.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 commands/utility/setAvatar.js diff --git a/commands/utility/setAvatar.js b/commands/utility/setAvatar.js new file mode 100644 index 0000000..2fe9fe0 --- /dev/null +++ b/commands/utility/setAvatar.js @@ -0,0 +1,22 @@ +const { SlashCommandBuilder } = require('discord.js'); + +module.exports = { + category: 'utility', + global: true, + data: new SlashCommandBuilder() + .setName('set_avatar') + .setDescription('Update the bots user image') + .addAttachmentOption(option => + option.setName('image') + .setDescription('Image to use') + .setRequired(true)), + async execute(interaction) { + if(!['222457277708369928'].includes(interaction.member.id)) { + await interaction.reply("Insufficient permissions!"); + return; + } + + await interaction.client.user.setAvatar(interaction.options.getAttachment('image').url); + await interaction.reply("Updated avatar"); + }, +}; \ No newline at end of file