1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-17 12:23:08 +00:00

API: fix wrong constants getting used for fetch limits

This commit is contained in:
mavolin 2020-11-21 15:53:57 +01:00 committed by diamondburned
parent d6a45529ad
commit 59d2ac8959
3 changed files with 5 additions and 5 deletions

View file

@ -147,7 +147,7 @@ func (c *Client) GuildsBefore(before discord.GuildID, limit uint) ([]discord.Gui
if limit > 0 {
// Only fetch as much as we need. Since limit gradually decreases,
// we only need to fetch min(fetch, limit).
fetch = uint(min(maxMessageFetchLimit, int(limit)))
fetch = uint(min(maxGuildFetchLimit, int(limit)))
limit -= fetch
}
@ -192,7 +192,7 @@ func (c *Client) GuildsAfter(after discord.GuildID, limit uint) ([]discord.Guild
if limit > 0 {
// Only fetch as much as we need. Since limit gradually decreases,
// we only need to fetch min(fetch, limit).
fetch = uint(min(maxMessageFetchLimit, int(limit)))
fetch = uint(min(maxGuildFetchLimit, int(limit)))
limit -= fetch
}

View file

@ -47,7 +47,7 @@ func (c *Client) MembersAfter(
// Only fetch as much as we need. Since limit gradually decreases,
// we only need to fetch min(fetch, limit).
if limit > 0 {
fetch = uint(min(maxMessageFetchLimit, int(limit)))
fetch = uint(min(maxMemberFetchLimit, int(limit)))
limit -= fetch
}

View file

@ -64,7 +64,7 @@ func (c *Client) ReactionsBefore(
if limit > 0 {
// Only fetch as much as we need. Since limit gradually decreases,
// we only need to fetch min(fetch, limit).
fetch = uint(min(maxMessageFetchLimit, int(limit)))
fetch = uint(min(maxMessageReactionFetchLimit, int(limit)))
limit -= fetch
}
@ -110,7 +110,7 @@ func (c *Client) ReactionsAfter(
if limit > 0 {
// Only fetch as much as we need. Since limit gradually decreases,
// we only need to fetch min(fetch, limit).
fetch = uint(min(maxMessageFetchLimit, int(limit)))
fetch = uint(min(maxMessageReactionFetchLimit, int(limit)))
limit -= fetch
}