My discord bot checks reactions of a discord message and after it processed info about all reactions and its users, it sends relevant info. How to make it so that console.log(‘after’) happens after every reaction has been processed? (Discord.js v14)
const messageReacted = await reaction.client.channels.cache.get(reaction.message.channelId).messages.fetch(reaction.message.id);
await messageReacted.reactions.cache.forEach(async(msg_reaction) => {
const emojiName = msg_reaction._emoji.name
const reactionUsers = await msg_reaction.users.fetch();
let user_list = [];
reactionUsers.forEach(user => {
if(user.bot === false) {
user_list.push(`<@${user.id}>`);
}
});
/* Doing Stuff */
});
console.log('after');