hello by bot.js does not respond.

java

#1

hello by bot.js does not respond.


#2

May I know what is the error inside the console. Furthermore, Java isn’t supported by Glitch yet.


#3

(node:2002) DeprecationWarning: Collection#find: pass a function instead

8:40 PM


#4

(node:2039) DeprecationWarning: ClientUser#setGame: use ClientUser#setActivity instead

8:46 PM i am turkish


#5

ClientUser.setGame has been deprecated. Use setActivity or setPresence instead.

Client.user.setActivity('with Glitch', { type: 'WATCHING' }).then(console.log).catch(console.error);

Furthermore, Collection.find requires a function now, and it no longer accepts a property.

Collection.find(user => user.name === 'Name of the user');

#6

My problem is that it does not write, but does not write


#7

client.on(‘ready’, () => {
console.log(‘Im ready!’);
client.user.setPresence({
status: “online”,
game: {
name: “!help”,
type: “PLAYING”
}
});
});


#8

bot.on(“ready”, async () =>{
console.log(${bot.user.username} is online It's running on ${bot.guilds.size} servers!);
bot.user.setActivity(${bot.guilds.size} servers - !help, {type: “WATCHING”});
})

that’s is what I did to set the activity it will post the sever count along with the help command. and sets it to watching, you will also be told the bots username is and the amount of servers the bot is on in the logs