Fixed first database creation, added default values for some get's

This commit is contained in:
BarsTiger
2023-05-19 14:51:10 +03:00
parent 5f079c5246
commit c332dc4d21
13 changed files with 33 additions and 32 deletions

View File

@@ -6,7 +6,7 @@ from bot.utils.errorable_command import wrap_exception
@wrap_exception()
@throttle(cooldown=5, admin_ids=db[DBTables.config].get('admins'))
@throttle(cooldown=5, admin_ids=db[DBTables.config].get('admins', []))
async def get_current(message: types.Message):
prompt: Prompt = db[DBTables.prompts].get(message.from_id)
if prompt is None:

View File

@@ -7,7 +7,7 @@ from bot.utils.errorable_command import wrap_exception
@wrap_exception()
@throttle(cooldown=5*60, admin_ids=db[DBTables.config].get('admins'), by_id=False)
@throttle(cooldown=5*60, admin_ids=db[DBTables.config].get('admins', []), by_id=False)
async def set_model_command(message: types.Message):
if db[DBTables.config].get('whitelist') and \
(message.chat.id not in db[DBTables.config]['whitelist'] and