randydev commited on
Commit
7d7329b
·
verified ·
1 Parent(s): 83c1b35

Update chatbot/plugins/chat.py

Browse files
Files changed (1) hide show
  1. chatbot/plugins/chat.py +2 -2
chatbot/plugins/chat.py CHANGED
@@ -481,10 +481,11 @@ async def chatbot_talk(client: Client, message: Message):
481
  if message.photo:
482
  file_photo = None
483
  try:
 
484
  await client.send_chat_action(message.chat.id, enums.ChatAction.UPLOAD_PHOTO)
485
  await asyncio.sleep(1.5)
486
 
487
- if re.findall(r"\b(.editimage)\b", str(message.caption), re.IGNORECASE):
488
  await db.backup_chatbot.update_one(
489
  {"user_id": message.from_user.id},
490
  {"$set": {"background_file_id": message.photo.file_id}},
@@ -510,7 +511,6 @@ async def chatbot_talk(client: Client, message: Message):
510
  )
511
  return
512
 
513
- caption = message.caption or "What this?"
514
  backup_chat = await db._get_chatbot_chat_from_db(message.from_user.id)
515
  backup_chat.append({"role": "user", "parts": [{"text": caption}]})
516
  file_photo = await gen.aio.files.upload(file=await message.download())
 
481
  if message.photo:
482
  file_photo = None
483
  try:
484
+ caption = message.caption or "What this?"
485
  await client.send_chat_action(message.chat.id, enums.ChatAction.UPLOAD_PHOTO)
486
  await asyncio.sleep(1.5)
487
 
488
+ if re.findall(r"\b(\.editimage)\b", str(caption), re.IGNORECASE):
489
  await db.backup_chatbot.update_one(
490
  {"user_id": message.from_user.id},
491
  {"$set": {"background_file_id": message.photo.file_id}},
 
511
  )
512
  return
513
 
 
514
  backup_chat = await db._get_chatbot_chat_from_db(message.from_user.id)
515
  backup_chat.append({"role": "user", "parts": [{"text": caption}]})
516
  file_photo = await gen.aio.files.upload(file=await message.download())