yrestom / erpnext_telegram

Telegram Integration for Erpnext
Other
97 stars 108 forks source link

Telegram Error on ERPNext - Cannot process any document #35

Open moizsami opened 1 year ago

moizsami commented 1 year ago

Hi,

Suddenly whenever I try to save any document which should trigger the telegram notification on ERPNext. The document cannot save and I receive the following error.

Traceback (most recent call last):
  File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_notification/telegram_notification.py", line 412, in evaluate_alert
    alert.send(doc)
  File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_notification/telegram_notification.py", line 148, in send
    self.send_a_telegram_msg(doc, context)
  File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_notification/telegram_notification.py", line 209, in send_a_telegram_msg
    send_to_telegram(
  File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_settings/telegram_settings.py", line 45, in send_to_telegram
    asyncio.run(bot.send_message(chat_id=telegram_chat_id, text=message))
  File "/usr/lib/python3.10/asyncio/runners.py", line 37, in run
    raise ValueError("a coroutine was expected, got {!r}".format(main))
ValueError: a coroutine was expected, got <telegram.message.Message object at 0x7ff2e91a6620>

I am using ERPNext 14, hosted on Frappe Cloud Our whole system is dependent on your amazing notification system. Please help me with this. Thanks :)

moizsami commented 1 year ago

Hi @yrestom , just wanted to ask were you able to check this issue and if there is any info about it please do share.

Thanks

moizsami commented 1 year ago

@yrestom sorry to bother you. but can we expect a resolution in the coming days or is something that will take time, as the integration was being used by on many production sites and all are stopped.

girumtibebu commented 11 months ago

I found the solution. The error was due to the python package not the integration app. downgrade phyton library to v20

pip uninstall python-telegram-bot ./env/bin/pip install python-telegram-bot=20.0 --upgrade bench build (important), bench migrate, bench clear-cache, bench restart gave me the solution. Thanks for the awesome app.

Vivdeveloper commented 3 months ago

@girumtibebu @yrestom We are using frappe cloud how do