From 9bc0d99aad0e7c2f6b775b5aa386b23013a55267 Mon Sep 17 00:00:00 2001 From: Synbulat Biishev Date: Sat, 4 Nov 2023 19:58:28 +0300 Subject: [PATCH] fix(GuildManager#fetch): inject shard id --- packages/discord.js/src/managers/GuildManager.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/discord.js/src/managers/GuildManager.js b/packages/discord.js/src/managers/GuildManager.js index 7266d9a0f102..447391cc25e3 100644 --- a/packages/discord.js/src/managers/GuildManager.js +++ b/packages/discord.js/src/managers/GuildManager.js @@ -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'); @@ -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); }