From 1653e184a81ec8ea99aa49344baef8ada00bfc45 Mon Sep 17 00:00:00 2001 From: vasmarfas <37144504+vasmarfas@users.noreply.github.com> Date: Wed, 3 May 2023 21:39:16 +0300 Subject: [PATCH] Update set_model.py Whitelisted set_model Chanched cooldown to 5 minutes --- bot/handlers/txt2img/set_model.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/handlers/txt2img/set_model.py b/bot/handlers/txt2img/set_model.py index 7d55562..dcc5634 100644 --- a/bot/handlers/txt2img/set_model.py +++ b/bot/handlers/txt2img/set_model.py @@ -7,8 +7,11 @@ from bot.utils.errorable_command import wrap_exception @wrap_exception() -@throttle(cooldown=30*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 (message.chat.id not in db[DBTables.config]['whitelist'] and message.from_id not in db[DBTables.config]['whitelist']): + await message.reply('❌You are not on the white list, access denied. Contact admin @kilisauros for details') + return models = await get_models() if models is not None and len(models) > 0: db[DBTables.config]['models'] = models