Urgent.News

What's breaking now, across thousands of outlets.

Tech

Your Discord bot's member cache is lying to you. Mine never timed out a single member.

I set largeThreshold: 50 in my Discord bot's client config. The comment next to it said it saved memory with no functional loss. That was wrong, and it took a log search to find out how wrong. What the setting really does largeThreshold is the large_threshold field in Discord's gateway IDENTIFY payload. It is the member count above which the gateway stops sending offline members when a guild…

The Discord bot's member cache was not accurately reflecting the entire online roster. The bot was only iterating over the members who were online or recently active, not the entire guild membership. The issue stemmed from a configuration setting called "largeThreshold" which only saves memory at the cost of functional loss. This largeThreshold field in Discord's gateway IDENTIFY payload determines the member count above which the gateway stops sending offline members when a guild loads.

Above this threshold, the bot only receives members who are currently online, meaning that after every restart, the member cache only held the online members plus those the bot had seen since. The author had a verification timeout sweep in place to act on members who did not complete verification in time. However, the sweep never logged any actions because the cache did not contain any inactive or offline members.

The author resolved this issue by keeping a separate table for pending verification and explicitly fetching the full member list before iterating, thus ensuring a complete list of members. The default Discord threshold of 250 would have prevented this issue, but at the author's custom threshold of 50, it was not enough. The takeaway from this experience is that before processing a guild's members, it is essential to verify whether the cache is comprehensive and whether offline members need to be factored in.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

I built a company of bots

Most agent demos are one clever prompt. I wanted to see what happens when you organize agents the way a real company is organized: departments, specialists, and someone at the top deciding who does…

  • Botropolis is a one-man company with AI agents for each department.
  • CEO agent coordinates tasks, assigns agents, and compiles reports.
  • YAML specs ensure transparency and performance analytics optimization.

How I Turned My Coding Interview Into a Jedi Mind Trick

The Quest Begins (The “Why”) I still remember my first technical interview like it was yesterday. I sat down, the interviewer tossed over a whiteboard marker, and the problem appeared: “Given an array…

  • Author overcame interview anxiety by mastering "Think Aloud with a Three‑Pass Script"
  • Restate problem, outline approach, code with narration systematically reveals thought process
  • Technique transforms coding interviews into collaborative problem‑solving, not interrogations

Realtime Channel and Message Queue Durability for Collaborative Cursor Notifications

A realtime channel makes a collaborative cursor notification immediate; a message queue makes its recovery durable. The awkward constraint is that replaying every old coordinate after a reconnect is…

  • Realtime channel enables immediate cursor updates
  • Message queue guarantees durability with state ordering
  • Monotonically increasing revision number ensures state consistency

More from Wednesday 30 September →