Home - PraumatFR/useful-functions GitHub Wiki

Welcome to the useful-functions wiki!

How to cache guild members ?

For this you need to activate an option on the discord website.

From there you go to your application then in bot and activate this : "SERVER MEMBERS INTENT"

Now you need to put this code :

const bot = new Discord.Client();
bot.on('ready', () => {
bot.guilds.cache.get(YourGuildID).members.fetch({force:true});
});

(I was quite lost the first time I saw that my programme couldn't recognize any event from some user)