ChecklistTask

@Serializable
sealed interface ChecklistTask : TextedInput(source)

Inheritors

Types

Link copied to clipboard
@Serializable(with = ChecklistTask.Serializer::class)
sealed interface Completed : ChecklistTask.Created
Link copied to clipboard
@Serializable(with = ChecklistTask.Serializer::class)
sealed interface Created : ChecklistTask
Link copied to clipboard
data class Input(val id: ChecklistTaskId, val text: String, val parseMode: ParseMode? = null, val textSources: List<TextSource> = emptyList()) : ChecklistTask
Link copied to clipboard
object Serializer : KSerializer<ChecklistTask.Created>
Link copied to clipboard
@Serializable(with = ChecklistTask.Serializer::class)
data class Uncompleted(val id: ChecklistTaskId, val textSources: List<TextSource> = emptyList()) : ChecklistTask.Created

Properties

Link copied to clipboard
abstract val id: ChecklistTaskId
Link copied to clipboard
abstract override val text: String
Link copied to clipboard
abstract override val textSources: List<TextSource>

Full list of TextSources

Functions

Link copied to clipboard
fun TextedWithTextSources.parseCommandsWithArgs(argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex): Map<String, Array<String>>

Parse commands and their args. Logic will find command, get all subsequent data as args until new command

Link copied to clipboard

Parse text sources to find commands with their arguments. This method will skip all the text sources before first command and all following text sources until the next command will be guessed as an args of last found command

Link copied to clipboard
fun TextedWithTextSources.parseCommandsWithNamedArgs(argsSeparator: String, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex): Map<String, List<Pair<String, String>>>
fun TextedWithTextSources.parseCommandsWithNamedArgs(argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex): Map<String, List<Pair<String, String>>>

Uses parseCommandsWithArgs to create base argsSeparator split args for commands and map their as k-v pairs. Sample: