From fe5a0b43c8b5c465e20f0e290150d9bd190dfa8f Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sat, 15 May 2021 11:36:28 -0500 Subject: [PATCH] Remove privileged intents (not needed) and use interaction.user.id as member is undefined in DMs --- bot/awesomescibo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/awesomescibo.js b/bot/awesomescibo.js index ee5fa0e..f48ffc5 100755 --- a/bot/awesomescibo.js +++ b/bot/awesomescibo.js @@ -3,7 +3,7 @@ const Discord = require("discord.js"); const Intents = Discord.Intents; const client = new Discord.Client({ - intents: ["GUILDS", "GUILD_MESSAGES", "GUILD_MESSAGE_REACTIONS", "DIRECT_MESSAGES", "DIRECT_MESSAGE_REACTIONS", "GUILD_MEMBERS", "GUILD_PRESENCES"], + intents: ["GUILDS", "GUILD_MESSAGES", "GUILD_MESSAGE_REACTIONS", "DIRECT_MESSAGES", "DIRECT_MESSAGE_REACTIONS"/*, "GUILD_MEMBERS", "GUILD_PRESENCES"*/], partials: ["MESSAGE", "CHANNEL", "REACTION"], }); const fetch = require("node-fetch"); @@ -99,7 +99,7 @@ async function updateScore(isCorrect, score, authorId) { } function training(subject, interaction) { - const authorId = interaction.member.user.id; + const authorId = interaction.user.id; let score; userScore .findOne({ authorID: authorId })