Skip to content

Make the bot the only Discord gateway connection for the account #85

Open

Description

@carolinaisslaying

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 statuses hash.
  • 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 statuses hash 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.

Activity

  1. moved this to Awaiting triage in Triageon Sep 13, 2026
  2. moved this from Awaiting triage to Moderate Priority in Triageon Sep 13, 2026
  3. carolinaisslaying commented on Sep 13, 2026

    @carolinaisslaying
    MemberAuthor

    An implementation note from the website side, for when the bot takes over the statuses hash:

    The website's guildMemberRemove handler sets a user to offline when 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature requestIssue/PR related to a feature implementation, etc.moderate priorityIssue/PR is moderate priority.

Projects

  • Status
    Moderate Priority

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions