mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
fix(GuildChannel): only fetch invites for the specific channel (#6132)
This commit is contained in:
@@ -146,8 +146,8 @@ class GuildInviteManager extends CachedManager {
|
|||||||
return data.reduce((col, invite) => col.set(invite.code, this._add(invite, cache)), new Collection());
|
return data.reduce((col, invite) => col.set(invite.code, this._add(invite, cache)), new Collection());
|
||||||
}
|
}
|
||||||
|
|
||||||
async _fetchChannelMany(channelID, cache) {
|
async _fetchChannelMany(channelId, cache) {
|
||||||
const data = await this.client.api.channels(channelID).invites.get();
|
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());
|
return data.reduce((col, invite) => col.set(invite.code, this._add(invite, cache)), new Collection());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -497,7 +497,7 @@ class GuildChannel extends Channel {
|
|||||||
* @returns {Promise<Collection<string, Invite>>}
|
* @returns {Promise<Collection<string, Invite>>}
|
||||||
*/
|
*/
|
||||||
fetchInvites(cache = true) {
|
fetchInvites(cache = true) {
|
||||||
return this.guild.invites.fetch({ channelID: this.id, cache });
|
return this.guild.invites.fetch({ channelId: this.id, cache });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user