I have my code here:
// ...
run: (client,message,args) =>{
let member = message.member
console.log(member.presence) // null
if(!member.presence) return message.say(`${n} - I cannot access **${member.nickname || member.user.tag}**'s presence.`)
if(!member.presence.activities[0]) return message.reply(`${n} - No activity detected from \`${member.user.tag} !\``)
message.reply('Informations logged on the console.')
console.log(member.presence)
}
I keep having my bot sending this:
After having checked if other people got the same issue I only saw people who didn't activated the following check boxes:
The thing is I already did and no matter how many times I rerun my bot, member.presence
keeps being null and I can't understand why.
Okay so I've been checking around a little more and I found out it's just because I didn't put GUILD_PRESENCES
in my intents, silly me. So I just had to change
const client = new Discord.Client({
intents : [
"GUILDS",
"GUILD_MEMBERS",
"GUILD_MESSAGES"
]
})
to
const client = new Discord.Client({
intents : [
"GUILDS",
"GUILD_MEMBERS",
"GUILD_MESSAGES",
"GUILD_PRESENCES"
]
})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.