fix: remove get query loop loop de loop loop

This commit is contained in:
Skillz4Killz
2022-03-26 00:11:47 +00:00
committed by GitHub
parent 80d2e94840
commit b06f6d2512
15 changed files with 126 additions and 81 deletions
+10 -2
View File
@@ -16,11 +16,19 @@ export async function getReactions(
reaction = reaction.substring(3, reaction.length - 1);
}
let url = bot.constants.endpoints.CHANNEL_MESSAGE_REACTION(channelId, messageId, encodeURIComponent(reaction));
if (options) {
url += "?";
if (options.after) url += `after=${options.after}`;
if (options.limit) url += `&limit=${options.limit}`;
}
const users = await bot.rest.runMethod<DiscordUser[]>(
bot.rest,
"get",
bot.constants.endpoints.CHANNEL_MESSAGE_REACTION(channelId, messageId, encodeURIComponent(reaction)),
options,
url,
);
return new Collection(users.map((u) => {