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 Get Chat Id Issue #2004

Open
Yaswanthkumar939092 opened this issue Jul 27, 2023 · 0 comments
Open

Telegram Get Chat Id Issue #2004

Yaswanthkumar939092 opened this issue Jul 27, 2023 · 0 comments

Comments

@Yaswanthkumar939092
Copy link

App Versions

{
	"chat": "0.0.1",
	"erpnext": "14.27.1",
	"erpnext_telegram_integration": "1.2.0",
	"four_whats_net": "0.0.6",
	"frappe": "14.39.0",
	"geocode_farmcd": "0.0.1",
	"healthcare": "15.0.0-dev",
	"hrms": "15.0.0-dev",
	"library": "0.0.1",
	"my_app": "0.0.1",
	"payments": "0.0.1"
}

Route

Form/Telegram User Settings/yaswanthkumardasari@gmail.com-Telegram1

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 66, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 47, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1608, in call
    return fn(*args, **newargs)
  File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_user_settings/telegram_user_settings.py", line 52, in get_chat_id_button
    chat_id = asyncio.run(get_chat_id(telegram_token_bot, telegram_token))
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "apps/erpnext_telegram_integration/erpnext_telegram_integration/erpnext_telegram_integration/doctype/telegram_user_settings/telegram_user_settings.py", line 61, in get_chat_id
    updates = await bot.get_updates(limit=200)
  File "env/lib/python3.10/site-packages/telegram/_bot.py", line 388, in decorator
    result = await func(self, *args, **kwargs)  # skipcq: PYL-E1102
  File "env/lib/python3.10/site-packages/telegram/_bot.py", line 3668, in get_updates
    await self._post(
  File "env/lib/python3.10/site-packages/telegram/_bot.py", line 476, in _post
    return await self._do_post(
  File "env/lib/python3.10/site-packages/telegram/_bot.py", line 504, in _do_post
    return await request.post(
  File "env/lib/python3.10/site-packages/telegram/request/_baserequest.py", line 168, in post
    result = await self._request_wrapper(
  File "env/lib/python3.10/site-packages/telegram/request/_baserequest.py", line 327, in _request_wrapper
    raise Conflict(message)
telegram.error.Conflict: Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first

Request Data

{
	"type": "POST",
	"args": {
		"telegram_token": "/7405cd836943db45d2c8553cb234cc251632fb",
		"telegram_settings": "Telegram1"
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/erpnext_telegram_integration.erpnext_telegram_integration.doctype.telegram_user_settings.telegram_user_settings.get_chat_id_button"
}

Response Data

{
	"exception": "telegram.error.Conflict: Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants