filterCommandsWithArgs

fun <T : ContentMessage<TextContent>> Flow<T>.filterCommandsWithArgs(commandRegex: Regex): Flow<Pair<T, List<TextSource>>>

Convert incoming dev.inmo.tgbotapi.types.message.abstracts.ContentMessage.content of messages with fullEntitiesList and check that incoming message contains first TextSource as BotCommandTextSource. Besides, it is checking that BotCommandTextSource.command with incoming commandRegex and for other TextSource objects used next rules: all incoming text sources will be passed as is, RegularTextSource will be split by " " for several RegularTextSource which will contains not empty args without spaces.

Return

Paired original message and converted list with first entity BotCommandTextSource and than all others according to rules in description

See also