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

Error "'NoneType' object has no attribute 'chat'" when attempting to reserve bag through telegram bot #481

Open
lucastwg opened this issue Mar 18, 2024 · 3 comments

Comments

@lucastwg
Copy link

When attempting to reserve a bag through the /reserve command, the locations present as normal but the bot times out when selecting a location, checking bot shows [error "'NoneType' object has no attribute 'chat'"], the string is much longer and mentions callback_query=CallbackQuery but it contains a lot of personal information so I cannot share the whole string.

@edides
Copy link

edides commented Mar 31, 2024

faced the same issue, anyone has a solution?

@floriegl
Copy link
Contributor

floriegl commented May 7, 2024

Yes, it got broken in d04f8c9 . Checking out v1.20.3 should fix that. _is_my_chat function only checks chat.id but the fallback does not have a chat attribute, but only a user attribute which has the same id (don't know how it works for group chats tho.

@Der-Henning please don't create a release of the current master with this bug.

@floriegl
Copy link
Contributor

floriegl commented May 7, 2024

Also this is the full message: Update "Update(callback_query=CallbackQuery(chat_instance='<chat_instance_id>', data=<tgtg_scanner.models.item.Item object at 0xXXXXXXXXXXXX>, from_user=User(first_name='<user_first_name>', id=<IMPORTANT_CHAT_ID>, is_bot=False, language_code='de', username='<user_username>'), id='<callback_query_id>', message=Message(channel_chat_created=False, chat=Chat(first_name='<user_first_name>', id=<IMPORTANT_CHAT_ID>, type=<ChatType.PRIVATE>, username='<user_username>'), date=datetime.datetime(<year>, <month>, <day>, <hour>, <minutes>, <seconds>, tzinfo=datetime.timezone.utc), delete_chat_photo=False, from_user=User(first_name='<bot_first_name>', id=<bot_id>, is_bot=True, username='<bot_username>'), group_chat_created=False, message_id=<short_message_id>, reply_markup=InlineKeyboardMarkup(inline_keyboard=<just_all_the_buttons_of_the_previous_message>), supergroup_chat_created=False, text='Select a Bag to reserve')), update_id=<update_id>)" caused error "'NoneType' object has no attribute 'chat'"

Der-Henning added a commit that referenced this issue May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants