Regular

Types

Link copied to clipboard
@Serializable
data class Common(val gift: Gift.Regular, val sendDate: TelegramDate, val senderUser: PreviewUser? = null, val text: String? = null, entities: RawMessageEntities? = null, val isPrivate: Boolean = false, val isSaved: Boolean = false, val canBeUpgraded: Boolean = false, val wasRefunded: Boolean = false, val convertStarCount: Int? = null, val prepaidUpgradeStarCount: Int? = null, val isUpgradeSeparate: Boolean = false, val uniqueGiftNumber: Int? = null) : OwnedGift.Regular, OwnedGift.Common
Link copied to clipboard
object Companion : KSerializer<OwnedGift.Regular>
Link copied to clipboard
@Serializable
data class OwnedByBusinessAccount(val gift: Gift.Regular, val sendDate: TelegramDate, val ownedGiftId: GiftId, val senderUser: PreviewUser? = null, val text: String? = null, entities: RawMessageEntities? = null, val isPrivate: Boolean = false, val isSaved: Boolean = false, val canBeUpgraded: Boolean = false, val wasRefunded: Boolean = false, val convertStarCount: Int? = null, val prepaidUpgradeStarCount: Int? = null, val isUpgradeSeparate: Boolean = false, val uniqueGiftNumber: Int? = null) : OwnedGift.Regular, OwnedGift.OwnedByBusinessAccount

Properties

Link copied to clipboard
abstract val canBeUpgraded: Boolean
Link copied to clipboard
abstract val convertStarCount: Int?
Link copied to clipboard
abstract override val gift: Gift.Regular
Link copied to clipboard
abstract val isPrivate: Boolean
Link copied to clipboard
abstract val isSaved: Boolean
Link copied to clipboard
Link copied to clipboard
abstract val ownedGiftId: GiftId?
Link copied to clipboard
Link copied to clipboard
abstract val sendDate: TelegramDate
Link copied to clipboard
abstract val senderUser: PreviewUser?
Link copied to clipboard
abstract val text: String?
Link copied to clipboard
abstract override val textSources: List<TextSource>

Full list of TextSources

Link copied to clipboard
abstract val uniqueGiftNumber: Int?
Link copied to clipboard
abstract val wasRefunded: Boolean

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: