const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS] });
So for this function I reused code from another project. However since then discord has changed libraries for the intents. I was wondering if anyone knows how to convert these variables or how to rewrite the chunk. I searched online for the answer but no luck...
client.on('messageReactionAdd', async (reaction, user) => {
if (reaction.message.partial) await reaction.message.fetch();
if (reaction.partial) await reaction.fetch();
if (user.bot) return;
if (!reaction.message.guild) return;
if (reaction.message.channel.id == channel) {
if (reaction.emoji.name === hotFaceEmoji) {
await reaction.message.guild.members.cache.get(user.id).roles.add(extrovertRole);
}
if (reaction.emoji.name === coldFaceEmoji) {
await reaction.message.guild.members.cache.get(user.id).roles.add(introvertRole);
}
} else {
return;
}
});
Error Message:
(node:12044) UnhandledPromiseRejectionWarning: ReferenceError: AbortController is not defined
at RequestHandler.execute (I:\DiscordManagment\ReactionRolesAnimeHub\node_modules\discord.js\src\rest\RequestHandler.js:172:15)
at RequestHandler.execute (I:\DiscordManagment\ReactionRolesAnimeHub\node_modules\discord.js\src\rest\RequestHandler.js:176:19)
at RequestHandler.push (I:\DiscordManagment\ReactionRolesAnimeHub\node_modules\discord.js\src\rest\RequestHandler.js:50:25)
at async WebSocketManager.connect (I:\DiscordManagment\ReactionRolesAnimeHub\node_modules\discord.js\src\client\websocket\WebSocketManager.js:128:9)
at async Client.login (I:\DiscordManagment\ReactionRolesAnimeHub\node_modules\discord.js\src\client\Client.js:245:7)
(Use `node --trace-warnings ...` to show where the warning was created)