pyTelegramBotAPI
pyTelegramBotAPI copied to clipboard
problem with regexp
hi, I write this for example: @bot.message_handler(regexp = "london") def London_city(message): blabla but when a user send to bot: "london streets" , the above function react! how I get function reaction on just "london" phrase?!
This is the way regexp works.

Use lambda instead. bot.message_handler(func=lambda mess: mess.text == "london")