Image info, endpoint encryption
This commit is contained in:
@@ -2,6 +2,7 @@ from aiogram import types
|
||||
from bot.db import db, DBTables
|
||||
from bot.utils.cooldown import throttle
|
||||
from bot.keyboards.exception import get_exception_keyboard
|
||||
from bot.keyboards.image_info import get_img_info_keyboard
|
||||
from bot.utils.trace_exception import PrettyException
|
||||
|
||||
|
||||
@@ -12,14 +13,15 @@ async def imginfo(message: types.Message):
|
||||
await message.reply('❌ Reply with this command on picture', parse_mode='html')
|
||||
return
|
||||
|
||||
if not (original_r := db[DBTables.generated].get(message.reply_to_message.photo[0].file_unique_id)):
|
||||
if not db[DBTables.generated].get(message.reply_to_message.photo[0].file_unique_id):
|
||||
await message.reply('❌ This picture wasn\'t generated using this bot '
|
||||
'or doesn\'t exist in database. Note this only works on '
|
||||
'files forwarded from bot.', parse_mode='html')
|
||||
return
|
||||
|
||||
await message.reply(str(original_r))
|
||||
# TODO: Pretty print this
|
||||
await message.reply("Image was generated using this bot", reply_markup=get_img_info_keyboard(
|
||||
message.reply_to_message.photo[0].file_unique_id
|
||||
))
|
||||
|
||||
except IndexError:
|
||||
await message.reply('❌ Reply with this command on PICTURE', parse_mode='html')
|
||||
|
||||
Reference in New Issue
Block a user