randydev commited on
Commit
52b19bc
1 Parent(s): a814d53

Update chatbot/plugins/web.py

Browse files
Files changed (1) hide show
  1. chatbot/plugins/web.py +4 -2
chatbot/plugins/web.py CHANGED
@@ -2,7 +2,7 @@ import asyncio
2
  import time
3
  import os
4
  import datetime
5
-
6
  from pyrogram import Client, filters
7
  from pyrogram.types import *
8
  from pyrogram.enums import *
@@ -71,8 +71,10 @@ async def askwebcmd(client: Client, message: Message):
71
  backup_chat.append({"role": "assistant", "content": data.randydev.message})
72
  await pro.edit_text(data.randydev.message, disable_web_page_preview=True)
73
  await db._update_openai_chat_in_db(message.from_user.id, backup_chat)
 
 
74
  except Exception as e:
75
- await pro.edit_text(f"Error: {e}")
76
 
77
  @Client.on_message(filters.command("setlang"))
78
  async def setlang_cmd(client: Client, message: Message):
 
2
  import time
3
  import os
4
  import datetime
5
+ import aiohttp
6
  from pyrogram import Client, filters
7
  from pyrogram.types import *
8
  from pyrogram.enums import *
 
71
  backup_chat.append({"role": "assistant", "content": data.randydev.message})
72
  await pro.edit_text(data.randydev.message, disable_web_page_preview=True)
73
  await db._update_openai_chat_in_db(message.from_user.id, backup_chat)
74
+ except aiohttp.ContentTypeError as e:
75
+ return await pro.edit_text("Error: try again.")
76
  except Exception as e:
77
+ await pro.edit_text("Error: try again")
78
 
79
  @Client.on_message(filters.command("setlang"))
80
  async def setlang_cmd(client: Client, message: Message):