Discord bots connect to Discord's infrastructure at an intimate API level, and once enabled into a given "guild" or server, begin receiving a massive stream of events. These can be anything from ordinary channel messages to any administrative changes, arrival and departure of users, rearrangement of channels and roles and permissions, connect and disconnect to audio/video channels, etc. In most setups, the "bot sees all" because it's often serving to auto-moderate conversation traffic, but now I was curious whether Discord's infrastructure would honor its own permission structure and withhold events that a bot's permissions would prevent it [as a "user"] from receiving. In other words: would disallowing a bot's purview of most channel traffic physically limit the number of "regular" events being transmitted? Most bots have their own support servers, so I went off to those to try and find out. |
If we look at some basic bot stats, the volume of a popular one like YAGPDB
is really enormous.
A million and a half servers, all spewing events at once.
Now that's split across something over
760 shards,
so the stream volume to any one parsing engine could still be in the
hundreds of items per second.
In any of those blocks, we usually see between 100 and 300 per second, for
an average around 150 e/s per shard.
And I'll bet 95% of that is total fluff that isn't worth sending.
But what if server operators were more discerning, and were willing to at least limit traffic across 100 channels down to less than 10? Other than guild-wide events like user and role changes and other admin stuff, bot-driven things like rolemenus, command handlers, and even moderation could theoretically be confined to a much smaller purview. It's like pollution; if everyone cleans up their own little act, the world benefits. |