shay
Explore posts from serversDIAdiscord.js - Imagine an app
•Created by shay on 7/11/2024 in #djs-questions
Non-internal sharding without using a full `Client` instance
Hi there, I own a large bot that I'm rewriting to be mostly HTTP-based. However, there are a number of features that require a gateway connection, so I am going to be running a discord.js application alongside it which will proxy events to the HTTP server (the latency introduced with this method is not a big concern).
I have written the gateway-enabled bot portion with
@discordjs/rest
and @discordjs/ws
in order to minimize ram usage. Unfortunately it seems that ShardingManager
requires you to use a full-fat Client
instance, which I don't want to do because of the limited cache reduction options - I do not need any cache, only an array of guild IDs for each shard, which I am currently tracking myself.
^ the ready with [...]
log there is from my WebSocketManager#on
WebSocketShardEvents.Ready
callback. The manager is ready but it seems like the parent ShardManager expects a Client
instead. Is there any way to maintain my desired philosophy? Thanks
discord.js
14.15.3
@discordjs/rest
2.3.0
@discordjs/ws
1.1.1
node 21.6.221 replies