i wanted to set a member counter status for my bot the code is:
client.on('ready', () => {
setInterval(() => {
targetGuild = client.guilds.cache.get('I Pasted my Guild ID Here')
if(targetGuild) {
client.user.setPresence({ game: { name: targetGuild.memberCount + 'Members', type: 'WATCHING' }, status: 'online' })
.then(console.log)
.catch(console.error);
}
}, 1000 * 60 * 5);
});
And the error is:
client.user.setPresence(...).then is not a function
In discord.js v13, setPresence returns a ClientPresence, not a Promise as in v12, so there is no .then() method.
If you are using djs v13 you need to use:
client.user.setPresence({
activities: [{ name: `${targetGuild.memberCount} Members`, type: 'WATCHING' }],
status: 'online'
})
And also there is no .then() method because in discord.js v13 setPresence doesn't return a Promise but ClientPresence