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.
24 lines
555 B
Python
24 lines
555 B
Python
from meta import client, conf, log, sharding
|
|
|
|
from data import tables
|
|
|
|
import core # noqa
|
|
|
|
import modules # noqa
|
|
|
|
# Load and attach app specific data
|
|
if sharding.sharded:
|
|
appname = f"{conf.bot['data_appid']}_{sharding.shard_count}_{sharding.shard_number}"
|
|
else:
|
|
appname = conf.bot['data_appid']
|
|
client.appdata = core.data.meta.fetch_or_create(appname)
|
|
|
|
client.data = tables
|
|
|
|
# Initialise all modules
|
|
client.initialise_modules()
|
|
|
|
# Log readyness and execute
|
|
log("Initial setup complete, logging in", context='SETUP')
|
|
client.run(conf.bot['TOKEN'])
|