I
I
iacsvrn2019-12-29 14:46:15
Python
iacsvrn, 2019-12-29 14:46:15

How to correctly process strings in Russian in RegexHandler id?

current code that works:

def start(bot, update):
    reply_keyboard =[
                    ['One'],
                    ['Two']
                    ]

    return SOME

    
SOME: [RegexHandler('^(One|Two)$', gender)],

need to process Russian words, but the code below doesn't work:
def start(bot, update):
    reply_keyboard =[
                    ['Один'],
                    ['Два']
                    ]

    return SOME

    
SOME: [RegexHandler('^(Один|Два)$', gender)],

that is, the output requires a Russian keyboard and its handler
full code example

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danil K., 2020-12-30
@Danya_Violet

@bot.message_handler(regexp=".*(отмен(?:а|ить|ите) печат(?:ь|и))")

it works so great

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question