Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(GuildChannel): only fetch invites for the specific channel #6132

Merged
merged 2 commits into from Jul 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/managers/GuildInviteManager.js
Expand Up @@ -146,8 +146,8 @@ class GuildInviteManager extends CachedManager {
return data.reduce((col, invite) => col.set(invite.code, this._add(invite, cache)), new Collection());
}

async _fetchChannelMany(channelID, cache) {
const data = await this.client.api.channels(channelID).invites.get();
async _fetchChannelMany(channelId, cache) {
const data = await this.client.api.channels(channelId).invites.get();
return data.reduce((col, invite) => col.set(invite.code, this._add(invite, cache)), new Collection());
}

Expand Down
2 changes: 1 addition & 1 deletion src/structures/GuildChannel.js
Expand Up @@ -497,7 +497,7 @@ class GuildChannel extends Channel {
* @returns {Promise<Collection<string, Invite>>}
*/
fetchInvites(cache = true) {
return this.guild.invites.fetch({ channelID: this.id, cache });
return this.guild.invites.fetch({ channelId: this.id, cache });
}

/**
Expand Down