From 598eac4f8eb84e061ec7a5278b7a33d2abfaae3d Mon Sep 17 00:00:00 2001 From: Tanya <80748971+Tanya575@users.noreply.github.com> Date: Tue, 18 May 2021 13:28:20 +0400 Subject: [PATCH] update discord_bot.js so i just make changes with idle and online commands and make it in one command for example if you want to set it to online just type status online and it will change / you can also use this method to make a command that change the bot activity type and content --- discord_bot.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/discord_bot.js b/discord_bot.js index 0ee8ffb..f673758 100755 --- a/discord_bot.js +++ b/discord_bot.js @@ -158,16 +158,19 @@ commands = { } }, }, - idle: { - description: "Sets bot status to idle.", + status: { + description: "Sets bot status to idle/online.", process: function (bot, msg, suffix) { - bot.user.setStatus("idle").then(console.log).catch(console.error); - }, - }, - online: { - description: "Sets bot status to online.", - process: function (bot, msg, suffix) { - bot.user.setStatus("online").then(console.log).catch(console.error); + if(massage.author.id !== yor id here) return; // here you check if the message auhor id was the same (so only you can use it) + if (args[0] === "idle") { + type = 0 + } else if (args[0] === "online"){ + type = 1 + } + args.shift() + bot.user.setStatus(type).then(console.log).catch(console.error); + + message.channel.send('status changed') }, }, say: {