diff --git a/gateway/handleOnMessage.ts b/gateway/handleOnMessage.ts index d9d96940f..bd68b8d39 100644 --- a/gateway/handleOnMessage.ts +++ b/gateway/handleOnMessage.ts @@ -97,8 +97,19 @@ export async function handleOnMessage(gateway: GatewayManager, message: any, sha // Important for RESUME if (messageData.t === "READY") { + // Wait few seconds to spawn next shard + const bucket = gateway.buckets.get(shardId % gateway.maxConcurrency); + if (bucket?.createNextShard.length) { + // await delay(gateway.spawnShardDelay); + // setTimeout(() => { + console.log("shifting to create new shard"); + bucket.createNextShard.shift()?.(); + // }, gateway.spawnShardDelay); + } + const shard = gateway.shards.get(shardId); const payload = messageData.d as DiscordReady; + if (shard) { shard.sessionId = payload.session_id; shard.ready = true; @@ -108,13 +119,6 @@ export async function handleOnMessage(gateway: GatewayManager, message: any, sha gateway.loadingShards.get(shardId)?.resolve(true); gateway.loadingShards.delete(shardId); - // Wait few seconds to spawn next shard - const bucket = gateway.buckets.get(shardId % gateway.maxConcurrency); - if (bucket?.createNextShard.length) { - setTimeout(() => { - bucket.createNextShard.shift()?.(); - }, gateway.spawnShardDelay); - } } // Update the sequence number if it is present diff --git a/plugins/permissions/src/messages/create.ts b/plugins/permissions/src/messages/create.ts index f26ca6a54..efffaf6d7 100644 --- a/plugins/permissions/src/messages/create.ts +++ b/plugins/permissions/src/messages/create.ts @@ -18,7 +18,6 @@ export function sendMessage(bot: BotWithCache) { channel && [ ChannelTypes.GuildCategory, - ChannelTypes.GuildStore, ChannelTypes.GuildStageVoice, ].includes(channel.type) ) { diff --git a/types/shared.ts b/types/shared.ts index 74df96117..159af762e 100644 --- a/types/shared.ts +++ b/types/shared.ts @@ -270,8 +270,6 @@ export enum ChannelTypes { GuildCategory, /** A channel that users can follow and crosspost into their own server */ GuildNews, - /** A channel in which game developers can sell their game on Discord */ - GuildStore, /** A temporary sub-channel within a GUILD_NEWS channel */ GuildNewsThread = 10, /** A temporary sub-channel within a GUILD_TEXT channel */