Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The following wonderful people contributed directly or indirectly to this projec
- `Jacob Bom <https://github.com/bomjacob>`_
- `JASON0916 <https://github.com/JASON0916>`_
- `jeffffc <https://github.com/jeffffc>`_
- `Jelle Besseling <https://github.com/pingiun>`_
- `jh0ker <https://github.com/jh0ker>`_
- `John Yong <https://github.com/whipermr5>`_
- `jossalgon <https://github.com/jossalgon>`_
Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/conversationhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _get_key(self, update):
if self.per_chat:
key.append(chat.id)

if self.per_user:
if self.per_user and user is not None:
key.append(user.id)

if self.per_message:
Expand Down
6 changes: 6 additions & 0 deletions tests/test_conversationhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ def test_perChatMessageWithoutChat(self):
update = Update(0, callback_query=cbq)
handler.check_update(update)

def test_channelMessageWithoutChat(self):
handler = ConversationHandler(entry_points=[CommandHandler('start', self.start_end)], states={}, fallbacks=[])
message = Message(0, None, None, Chat(0, Chat.CHANNEL, "Misses Test"))
update = Update(0, message=message)
handler.check_update(update)


if __name__ == '__main__':
unittest.main()