diff --git a/bot/bot.py b/bot/bot.py index a59bca0..5a15840 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -17,7 +17,8 @@ class HahaNoUR(Bot): def __init__(self, prefix: str, start_time: int, colour: int, logger, session_manager: SessionManager, db: MongoClient, - error_log: int, feedback_log: int, shard_id: int): + error_log: int, feedback_log: int, shard_id: int, + shard_count: int): """ Init the instance of HahaNoUR. :param prefix: the bot prefix. @@ -28,7 +29,7 @@ def __init__(self, prefix: str, start_time: int, colour: int, logger, :param db: the MongoDB data controller. :param error_log: the channel id for error log. """ - super().__init__(prefix, shard_id=shard_id) + super().__init__(prefix, shard_id=shard_id, shard_count=shard_count) self.prefix = prefix self.colour = colour self.start_time = start_time diff --git a/main.py b/main.py index 78f2a85..b37b6dd 100644 --- a/main.py +++ b/main.py @@ -18,8 +18,9 @@ def main(): shard = 0 - if len(sys.argv) > 1: + if len(sys.argv) > 2: shard = int(sys.argv[1]) + shard_count = int(sys.argv[2]) print(shard) start_time = int(time()) @@ -37,7 +38,7 @@ def main(): bot = HahaNoUR( config['default_prefix'], start_time, int(config['colour'], base=16), logger, session_manager, db, auth['error_log'], auth['feedback_log'], - shard_id = shard + shard, shard_count ) bot.remove_command('help')