mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2026-06-19 07:35:19 +00:00
Make Gender Input Case-Insensitive in `conversationbot.py` (#4855)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
other= "Make Gender Input Case-Insensitive in ``conversationbot.py``"
|
||||
[[pull_requests]]
|
||||
uid = "4855"
|
||||
author_uid = "fengxiaohu"
|
||||
closes_threads = ["4846"]
|
||||
@@ -145,7 +145,9 @@ def main() -> None:
|
||||
conv_handler = ConversationHandler(
|
||||
entry_points=[CommandHandler("start", start)],
|
||||
states={
|
||||
GENDER: [MessageHandler(filters.Regex("^(Boy|Girl|Other)$"), gender)],
|
||||
# Use case-insensitive regex to accept gender input regardless of letter casing,
|
||||
# e.g., "boy", "BOY", "Girl", etc., will all be matched
|
||||
GENDER: [MessageHandler(filters.Regex("(?i)^(Boy|Girl|Other)$"), gender)],
|
||||
PHOTO: [MessageHandler(filters.PHOTO, photo), CommandHandler("skip", skip_photo)],
|
||||
LOCATION: [
|
||||
MessageHandler(filters.LOCATION, location),
|
||||
|
||||
Reference in New Issue
Block a user