Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(GuildManager#fetch): inject shard id (#9921)
  • Loading branch information
Syjalo committed Nov 4, 2023
1 parent a9e1f60 commit 85753a9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/discord.js/src/managers/GuildManager.js
Expand Up @@ -6,6 +6,7 @@ const { Collection } = require('@discordjs/collection');
const { makeURLSearchParams } = require('@discordjs/rest');
const { Routes, RouteBases } = require('discord-api-types/v10');
const CachedManager = require('./CachedManager');
const ShardClientUtil = require('../sharding/ShardClientUtil');
const { Guild } = require('../structures/Guild');
const GuildChannel = require('../structures/GuildChannel');
const GuildEmoji = require('../structures/GuildEmoji');
Expand Down Expand Up @@ -272,6 +273,7 @@ class GuildManager extends CachedManager {
const data = await this.client.rest.get(Routes.guild(id), {
query: makeURLSearchParams({ with_counts: options.withCounts ?? true }),
});
data.shardId = ShardClientUtil.shardIdForGuildId(id, this.client.options.shardCount);
return this._add(data, options.cache);
}

Expand Down

0 comments on commit 85753a9

Please sign in to comment.