Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram Error on ERPNext - Cannot process any document #35

Open
moizsami opened this issue Jul 18, 2023 · 4 comments
Open

Telegram Error on ERPNext - Cannot process any document #35

moizsami opened this issue Jul 18, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@moizsami
Copy link

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 :)

@yrestom yrestom added the bug Something isn't working label Jul 21, 2023
@moizsami
Copy link
Author

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
Copy link
Author

@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
Copy link

girumtibebu commented Oct 12, 2023

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
Copy link

Vivdeveloper commented Jun 20, 2024

@girumtibebu @yrestom We are using frappe cloud how do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants