OwnedByBusinessAccount

@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(source)

Constructors

Link copied to clipboard
constructor(gift: Gift.Regular, sendDate: TelegramDate, ownedGiftId: GiftId, senderUser: PreviewUser? = null, text: String? = null, entities: RawMessageEntities? = null, isPrivate: Boolean = false, isSaved: Boolean = false, canBeUpgraded: Boolean = false, wasRefunded: Boolean = false, convertStarCount: Int? = null, prepaidUpgradeStarCount: Int? = null, isUpgradeSeparate: Boolean = false, uniqueGiftNumber: Int? = null)

Properties

Link copied to clipboard
@SerialName(value = "can_be_upgraded")
open override val canBeUpgraded: Boolean
Link copied to clipboard
@SerialName(value = "convert_star_count")
open override val convertStarCount: Int?
Link copied to clipboard
@SerialName(value = "gift")
open override val gift: Gift.Regular
Link copied to clipboard
@SerialName(value = "is_private")
open override val isPrivate: Boolean
Link copied to clipboard
@SerialName(value = "is_saved")
open override val isSaved: Boolean
Link copied to clipboard
@SerialName(value = "is_upgrade_separate")
open override val isUpgradeSeparate: Boolean
Link copied to clipboard
@SerialName(value = "owned_gift_id")
open override val ownedGiftId: GiftId
Link copied to clipboard
@SerialName(value = "prepaid_upgrade_star_count")
open override val prepaidUpgradeStarCount: Int?
Link copied to clipboard
@SerialName(value = "send_date")
open override val sendDate: TelegramDate
Link copied to clipboard
@SerialName(value = "sender_user")
open override val senderUser: PreviewUser?
Link copied to clipboard
@SerialName(value = "text")
open override val text: String?
Link copied to clipboard
open override val textSources: List<TextSource>

Full list of TextSources

Link copied to clipboard
@SerialName(value = "unique_gift_number")
open override val uniqueGiftNumber: Int?
Link copied to clipboard
@SerialName(value = "was_refunded")
open override 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: