<divclass="content sourceset-depenent-content"data-active=""data-togglable=":docs:dokkaHtml/commonMain"><divclass="symbol monospace"><spanclass="token keyword"></span><spanclass="token keyword">fun </span><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="filter-commands-with-args.html">T</a><spanclass="token operator"> : </span><ahref="../dev.inmo.tgbotapi.types.update.abstracts/-base-sent-message-update/index.html">BaseSentMessageUpdate</a><spanclass="token operator">></span><spandata-unresolved-link="kotlinx.coroutines.flow/Flow///PointingToDeclaration/">Flow</span><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="filter-commands-with-args.html">T</a><spanclass="token operator">></span><spanclass="token punctuation">.</span><ahref="filter-commands-with-args.html"><spanclass="token function">filterCommandsWithArgs</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">commandRegex<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-regex/index.html">Regex</a></span></span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><spandata-unresolved-link="kotlinx.coroutines.flow/Flow///PointingToDeclaration/">Flow</span><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-pair/index.html">Pair</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="../dev.inmo.tgbotapi.types.message.abstracts/-content-message/index.html">ContentMessage</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="../dev.inmo.tgbotapi.types.message.content/-text-content/index.html">TextContent</a><spanclass="token operator">></span><spanclass="token punctuation">, </span><spanclass="token keyword"></span><ahref="../dev.inmo.tgbotapi.types.message.textsources/index.html#-1531751294%2FClasslikes%2F-1982836883">TextSourcesList</a><spanclass="token operator">></span><spanclass="token operator">></span><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><pclass="paragraph">Convert incoming <ahref="../dev.inmo.tgbotapi.types.message.abstracts/-content-message/content.html">dev.inmo.tgbotapi.types.message.abstracts.ContentMessage.content</a> of messages with fullEntitiesList and check that incoming message contains first <spandata-unresolved-link="dev.inmo.tgbotapi.types.MessageEntity.textsources/TextSource///PointingToDeclaration/">TextSource</span> as <spandata-unresolved-link="dev.inmo.tgbotapi.types.MessageEntity.textsources/BotCommandTextSource///PointingToDeclaration/">BotCommandTextSource</span>. Besides, it is checking that <ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-regex/matches.html">BotCommandTextSource.command</a> with incoming <ahref="filter-commands-with-args.html">commandRegex</a> and for other <spandata-unresolved-link="dev.inmo.tgbotapi.types.MessageEntity.textsources/TextSource///PointingToDeclaration/">TextSource</span> objects used next rules: all incoming text sources will be passed as is, <spandata-unresolved-link="dev.inmo.tgbotapi.types.MessageEntity.textsources/RegularTextSource///PointingToDeclaration/">RegularTextSource</span> will be split by "" for several <spandata-unresolved-link="dev.inmo.tgbotapi.types.MessageEntity.textsources/RegularTextSource///PointingToDeclaration/">RegularTextSource</span> which will contains not empty args without spaces.</p><h4class="">Return</h4><pclass="paragraph">Paired original message and converted list with first entity <spandata-unresolved-link="dev.inmo.tgbotapi.types.MessageEntity.textsources/BotCommandTextSource///PointingToDeclaration/">BotCommandTextSource</span> and than all others according to rules in description</p><h2