mattblin
mattblin
DIAdiscord.js - Imagine an app
Created by Joãozinho on 8/20/2023 in #djs-questions
How can I pull which invite the user used to join the discord
(just in case someone got the same issue : checked this morning, force option failed , option cache: false works in my case coz'
const oldInvites = customVarInvites; //CustomVarInvites was filled with a previous guild.invites.fetch();
customVarInvites = await guild.invites.fetch();
/**for loop on customVarInvites with 'uses' comparison*//
const oldInvites = customVarInvites; //CustomVarInvites was filled with a previous guild.invites.fetch();
customVarInvites = await guild.invites.fetch();
/**for loop on customVarInvites with 'uses' comparison*//
debugging this : *oldInvites *entries are the SAME as *customVarInvites * after fetching. Javascript not my thing so i didn't dig further, but from C/C++ PoV it's like both collection contains ref on cached data So putting cache: false does not affect oldInvites stored values and the loop can make a valid comparison)
9 replies
DIAdiscord.js - Imagine an app
Created by Joãozinho on 8/20/2023 in #djs-questions
How can I pull which invite the user used to join the discord
Yep you're right. Wanted to use force, and messed with cache. Strangely it fixed the exact same problem though 🤔 (Not the exact same code btw)
9 replies
DIAdiscord.js - Imagine an app
Created by Joãozinho on 8/20/2023 in #djs-questions
How can I pull which invite the user used to join the discord
avoid using cache when retrieving your invites
const invites = await guild.invites.fetch({ cache: false });
const invites = await guild.invites.fetch({ cache: false });
9 replies