mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Added status setting
You can now run bot.setStatusIdle() or bot.setStatusOnline() (or any aliases) to manually set the status of the bot.
This commit is contained in:
@@ -18,12 +18,14 @@ mybot.on("message", function (message) {
|
||||
// we can go ahead :)
|
||||
|
||||
var onlineUsers = 0;
|
||||
for(user of message.channel.users){
|
||||
if(user.status === "online" || user.status === "idle")
|
||||
onlineUsers++;
|
||||
}
|
||||
|
||||
mybot.setStatusIdle();
|
||||
|
||||
mybot.reply(message, onlineUsers);
|
||||
|
||||
setTimeout(function(){
|
||||
mybot.setStatusOnline();
|
||||
},5000);
|
||||
});
|
||||
|
||||
mybot.on("ready", function () {
|
||||
|
||||
Reference in New Issue
Block a user