configs and defaults

This commit is contained in:
Von Random 2024-10-23 14:26:09 +03:00
parent f7d9afbd43
commit abe38388b6
7 changed files with 17 additions and 3 deletions

View file

@ -30,7 +30,9 @@ class Responder:
self.enabled = True
self.apiregex = re.compile(r'^\{(\w+)\}(.+)?$')
self.namegen = pgbotlib.misc.NameGenerator(config, db_connection)
self.tokens = get_tokens(config['response_tokens'])
self.tokens = get_tokens(
config.get('response_tokens', pgbotlib.misc.Paths.TOKENS)
)
self.chats = config['chats']
self.api = pgbotlib.api.ApiWrapper(self.tokens, db_connection)
self.db_connection = db_connection