orenlab / pytmbot

Flexible Telegram bot designed to manage Docker containers, monitor server status, and extend its functionality through a plugin system
https://orenlab.github.io/pytmbot/
MIT License
7 stars 2 forks source link

Failed at Telebot package: 'CallbackQuery' object has no attribute 'chat' #58

Closed orenlab closed 1 month ago

orenlab commented 1 month ago

Describe the bug AttributeError: 'CallbackQuery' object has no attribute 'chat'

To Reproduce Run inline handler

Bot debug logs

2024-07-30 17:04:06 - pyTMbot - INFO - Failed at Telebot package: 'CallbackQuery' object has no attribute 'chat'
2024-07-30T17:04:06.565823882Z Traceback (most recent call last):
2024-07-30T17:04:06.565827632Z   File "/venv/lib/python3.12/site-packages/telebot/util.py", line 93, in run
2024-07-30T17:04:06.565830090Z     task(*args, **kwargs)
2024-07-30T17:04:06.565832007Z   File "/venv/lib/python3.12/site-packages/telebot/__init__.py", line 8725, in _run_middlewares_and_handler
2024-07-30T17:04:06.565834298Z     result = middleware.pre_process(message, data)
2024-07-30T17:04:06.565836632Z              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-30T17:04:06.565838548Z   File "/opt/pytmbot/app/core/middleware/auth.py", line 67, in pre_process
2024-07-30T17:04:06.565840632Z     chat_id = message.chat.id
2024-07-30T17:04:06.565842423Z               ^^^^^^^^^^^^
2024-07-30T17:04:06.565844257Z AttributeError: 'CallbackQuery' object has no attribute 'chat'
orenlab commented 1 month ago

It is necessary to fix with the logging level yet