Change img2img msg handler on telegram frontend

pull/4/head
Guillermo Rodriguez 2023-01-16 00:42:48 -03:00
parent 67286bfa23
commit d1fc9ab952
No known key found for this signature in database
GPG Key ID: EC3AB66D5D83B392
1 changed files with 4 additions and 1 deletions

View File

@ -125,12 +125,15 @@ async def run_skynet_telegram(
await bot.reply_to(message, resp_txt) await bot.reply_to(message, resp_txt)
@bot.message_handler(commands=['img2img'], content_types=['photo']) @bot.message_handler(func=lambda message: True, content_types=['photo'])
async def send_img2img(message): async def send_img2img(message):
chat = message.chat chat = message.chat
if chat.type != 'group' and chat.id != GROUP_ID: if chat.type != 'group' and chat.id != GROUP_ID:
return return
if not message.caption.startswith('/img2img'):
return
prompt = ' '.join(message.caption.split(' ')[1:]) prompt = ' '.join(message.caption.split(' ')[1:])
if len(prompt) == 0: if len(prompt) == 0: