I'm trying to make a bot (as a joke) that kicks a user when they're playing an specific game, I've been trying to use presence, but can't figure it out.
client.on('presenceUpdate', (oldPresence, newPresence) => {
let member = newPresence.member;
if (newPresence != null){
if (newPresence == 'osu!'){
member.kick();
}
}
});
This is very barebones, but I need to now what to do next.
First of all
newPresencedoes not return game value as you are trying to do withnewPresence == 'osu!', so it will turn out false everything, alsonewPresenceis not string so that is wrong also..To check what games user is playing or their activity you would need to check
The above code is a sample, probs won't even work but you need to check stuff, for example activities might be even null if there is no activity. Please check docs of DiscordJS to better understand presences