mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-05 07:53:47 +00:00
3.3 KiB
3.3 KiB
//docs/dev.inmo.tgbotapi.extensions.utils.updates/filterCommandsInsideTextMessages
filterCommandsInsideTextMessages
[common]
Content
fun <T : BaseSentMessageUpdate> <T>.filterCommandsInsideTextMessages(commandRegex: Regex): <ContentMessage<TextContent>>
More info
Convert incoming dev.inmo.tgbotapi.types.message.abstracts.ContentMessage.content of messages with fullEntitiesList and check that incoming message contains BotCommandTextSource. Besides, it is checking that BotCommandTextSource.command with incoming commandRegex
Return
The same message in case if it contains somewhere in text BotCommandTextSource with Regex.matches
See also
common
fullEntitiesList | |
asContentMessagesFlow | |
onlyTextContentMessages |