Shards #8333
Replies: 1 comment
-
You can think of sharding as running multiple smaller bots instead of a single bigger one. Same as for Discord sharding allows you to split the load of running your bot over multiple processes or servers and makes running very large bots possible. All Discord functionality such as slash commands are available when using it, however it might be worth noting that all DMs your bot receives will go to shard zero, regardless of what guilds your bot shares with a given user. As the bot is split into multiple pieces some library functionality like the built-in cache will behave differently and only have objects for the current shard. This means you can for example not call If you're running a small to medium-sized bot it's recommended to use discord.py's AutoShardedClient instead of manually sharding, as it will ask Discord for a recommended shard count and run them for you transparently while otherwise behaving the same way the regular Client does (including a unified cache!). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone again! Please tell us what shards are, their pros and cons, and, accordingly, advice: should I use them or not. Are they also compatible with slash commands?
Beta Was this translation helpful? Give feedback.
All reactions