Testing text2img command (will be replaced, only for tests); added exception handling, queue and database table with generated images

This commit is contained in:
BarsTiger
2023-02-20 16:41:55 +02:00
parent 3bd34009ae
commit d56f1d386f
21 changed files with 219 additions and 34 deletions

View File

@@ -0,0 +1,18 @@
from aiogram import types
from bot.db import db, DBTables
from bot.config import ADMIN
from bot.utils.cooldown import throttle
@throttle(5)
async def resetqueue(message: types.Message):
if message.from_id not in db[DBTables.config].get('admins') and message.from_id != ADMIN:
await message.reply('❌ You are not permitted to do that. '
'It is only for this bot instance maintainers and admins')
return
db[DBTables.queue]['n'] = 0
await db[DBTables.config].write()
await message.reply("✅ Reset queue")