This is a utility class that makes multi-process sharding of a bot an easy and painless experience. It works by spawning a self-contained or for each individual shard, each containing its own instance of your bot's Client. They all have a line of communication with the master process, and there are several useful methods that utilise it in order to simplify tasks that are normally difficult with sharding. It can spawn a specific number of shards or the amount that Discord suggests for the bot, and takes a path to your main bot script to launch for each one.
Path to the shard script file
Whether shards should automatically respawn upon exiting
Whether to pass the silent flag to child process (only when is
Amount of shards that all sharding managers spawn in total
Sends a message to all shards.
Creates a single shard. Using this method is usually not necessary if you use the spawn method.
ReturnsNote that the created shard needs to be explicitly spawned using its spawn method.
Fetches a client property value of each shard, or a given shard.
Kills all running shards and respawns them.
Spawns multiple shards.