sharding (core): Add base sharding support.
Add `meta.args` for command line argument access. Add command line argument support for shard number. Add shard count to config file. Add `meta.sharding` exposing shard properties. Add shard number to logging methods. Add shard number to data appid.
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
from discord import Intents
|
||||
from cmdClient.cmdClient import cmdClient
|
||||
|
||||
from .config import Conf
|
||||
from .config import conf
|
||||
from .sharding import shard_number, shard_count
|
||||
|
||||
from constants import CONFIG_FILE
|
||||
|
||||
# Initialise config
|
||||
conf = Conf(CONFIG_FILE)
|
||||
|
||||
# Initialise client
|
||||
owners = [int(owner) for owner in conf.bot.getlist('owners')]
|
||||
intents = Intents.all()
|
||||
intents.presences = False
|
||||
client = cmdClient(prefix=conf.bot['prefix'], owners=owners, intents=intents)
|
||||
client = cmdClient(
|
||||
prefix=conf.bot['prefix'],
|
||||
owners=owners,
|
||||
intents=intents,
|
||||
shard_id=shard_number,
|
||||
shard_count=shard_count
|
||||
)
|
||||
client.conf = conf
|
||||
|
||||
Reference in New Issue
Block a user