Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
Fixed Chatbot (html entiity AttributeError) (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
phaticusthiccy authored Apr 20, 2022
1 parent 2b9dae9 commit d850bae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions userbot/modules/__asena.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def txt(msg):

if BOT == "Y":
message = msg.raw_text
user_id = msg.sender.id
user_id = msg.sender_id
if message.startswith("asena") or message.startswith("Asena"):
if message.startswith("asena"):
message = message.replace("asena", "", 1)
Expand Down Expand Up @@ -139,7 +139,11 @@ async def txt(msg):
html = await response.text()
html2 = json.loads(html)
if html2["status"] == "OK":
fin_msg = html.unescape(html2["data"])
try:
fin_msg = html.unescape(html2["data"])
except:
fin_msg = html2["data"]

outtext = await translate_to_msg(fin_msg, "tr")
await msg.client.send_message(msg.chat_id, f"{outtext}", reply_to=msg, link_preview=False)
else:
Expand Down

0 comments on commit d850bae

Please sign in to comment.