So I am a very beginner coder and I want to learn more, I searched for some time how to do this and didn't find so I need some help.
I just want to make a bot when someone opens a game for exemple osu!, the bot to send a message to a text channel saying "*Persons name * joined osu!", and when they leave to say "*Persons name * left osu!".
I did this but it doesn't work.
const Discord = require('discord.js');
const client = new Discord.Client();
client.once('ready', () => {
console.log('ConnectionLogs is online!');
});
client.on("presenceUpdate", (oldMember, newMember) => {
if(newMember.id === '406742915352756235') {
if(newMember.presence.game.name === 'osu!') {
console.log('osu! detected!');
client.channels.get('573671522116304901').send('**Joining Game:**', {
files: [
]
});
}
}
});
client.login('MY TOKEN')