mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-16 12:25:45 +01:00
Fix "key not found" exception if the very first message handler in a ConversationHandler returns the state ConversationHandler.END.
This commit is contained in:
parent
00bba73673
commit
ab2d6eb494
1 changed files with 2 additions and 1 deletions
|
@ -213,7 +213,8 @@ class ConversationHandler(Handler):
|
|||
|
||||
def update_state(self, new_state, key):
|
||||
if new_state == self.END:
|
||||
del self.conversations[key]
|
||||
if key in self.conversations:
|
||||
del self.conversations[key]
|
||||
|
||||
elif isinstance(new_state, Promise):
|
||||
self.conversations[key] = (self.conversations[key], new_state)
|
||||
|
|
Loading…
Add table
Reference in a new issue