From 979c00ddc8b32479703babcdc0c7c80e76def541 Mon Sep 17 00:00:00 2001 From: Keanu Date: Thu, 13 Aug 2020 17:57:22 +0200 Subject: [PATCH] Added nick command to admin. --- src/commands/admin.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/commands/admin.ts b/src/commands/admin.ts index d113f83..f9b0069 100644 --- a/src/commands/admin.ts +++ b/src/commands/admin.ts @@ -105,6 +105,23 @@ export default new Command({ })); await $.message.channel.bulkDelete(travMessages); } + }), + nick: new Command({ + description: "Change the bot's nickname.", + permission: Command.PERMISSIONS.BOT_SUPPORT, + async run($: CommonLibrary): Promise + { + try { + const nickName = $.args.join(" "); + const trav = $.guild?.members.cache.find(member => member.id === $.client.user?.id); + await trav?.setNickname(nickName); + $.message.delete({timeout: 5000}); + $.channel.send(`Nickname set to \`${nickName}\``) + .then(m => m.delete({timeout: 5000})); + } catch (e) { + console.log(e); + } + } }) } }); \ No newline at end of file