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:
parent
d6a45529ad
commit
59d2ac8959
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue