Repository navigation
Make the bot the only Discord gateway connection for the account #85
Description
Is your feature request related to a problem? Please describe.
The website and this bot log in as the same Discord account. Every process connected to Discord's gateway receives events from every server that account is in, so once the bot can be invited to other servers (#82), the website's own discord.js connection would be in all of those servers too:
- It caches every member of every server (
GuildMemberManager: Infinity) and fetches every member with presences on startup (uploadStatuses). - It writes every presence update from every server into the Redis
statuseshash. - Past 2,500 servers Discord requires sharding, and both the website and the bot would need it: the same work done twice.
The website only needs statuses for listed bots and site users. The roles, kicks, DMs and member lookups it does on the DEL servers all work over REST.
Describe the solution you'd like
Make this bot the only gateway connection for the account, as part of the Pycord rewrite (#79):
- Track presence for listed bots and site users across every server the bot is in, and write it to the Redis
statuseshash in the format the website reads today (user ID →online/idle/dnd/offline). That means adding Redis to the bot. - Take over the other gateway-only data the website uses: the main server's member count (Datadog metric and member-count channel), and optionally the member data behind the website's About page and invite queue.
- Handle sharding in one place (
AutoShardedBot).
The website side is tracked in discordextremelist/website#375: it stops logging in to Discord and switches its few cache-based features to REST, shipped before or together with this so the website is never connected to the extra servers.
Describe alternatives you've considered
Keep presence tracking on the website and filter it to listed bots and site users. It works up to the sharding limit, but then sharding has to be set up in both repos.
Related
#82 (the change that makes this necessary), #79 (Pycord rewrite), #83 (verification, needed past 100 servers along with the members and presence intents), #81.
Additional context
Not guaranteed; this records the plan if #82 goes ahead.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsModerate Priority
Activity
carolinaisslaying commentedon Sep 13, 2026
An implementation note from the website side, for when the bot takes over the
statuseshash:The website's
guildMemberRemovehandler sets a user toofflinewhen they leave the DEL main server, even if they still share another server with the bot. Once the bot is in other servers, that would show listed bots and users as offline while they're online elsewhere. Only mark someone offline when they no longer share any server with the bot, or when their presence update says so.Also, Discord sends a presence update once for every server the bot shares with that user, so the same status may arrive several times. Writing it to Redis again is harmless, but it can be skipped if it hasn't changed.