mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-12-22 14:35:00 +01:00
Make all categories lower case to avoid KeyErrors (#1475)
This commit is contained in:
parent
9d005d5124
commit
24546bda67
1 changed files with 3 additions and 3 deletions
|
@ -62,13 +62,13 @@ def start(update, context):
|
||||||
|
|
||||||
|
|
||||||
def regular_choice(update, context):
|
def regular_choice(update, context):
|
||||||
text = update.message.text
|
text = update.message.text.lower()
|
||||||
context.user_data['choice'] = text
|
context.user_data['choice'] = text
|
||||||
if context.user_data.get(text):
|
if context.user_data.get(text):
|
||||||
reply_text = 'Your {}, I already know the following ' \
|
reply_text = 'Your {}, I already know the following ' \
|
||||||
'about that: {}'.format(text.lower(), context.user_data[text.lower()])
|
'about that: {}'.format(text, context.user_data[text])
|
||||||
else:
|
else:
|
||||||
reply_text = 'Your {}? Yes, I would love to hear about that!'.format(text.lower())
|
reply_text = 'Your {}? Yes, I would love to hear about that!'.format(text)
|
||||||
update.message.reply_text(reply_text)
|
update.message.reply_text(reply_text)
|
||||||
|
|
||||||
return TYPING_REPLY
|
return TYPING_REPLY
|
||||||
|
|
Loading…
Reference in a new issue