mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
upfill raw extensions
This commit is contained in:
parent
094d58f59f
commit
2096671147
@ -0,0 +1,9 @@
|
||||
package dev.inmo.tgbotapi.extensions.utils.extensions.raw
|
||||
|
||||
import dev.inmo.tgbotapi.types.ChatInviteLink
|
||||
import dev.inmo.tgbotapi.types.ChatJoinRequest
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val ChatJoinRequest.invite_link: ChatInviteLink
|
||||
get() = inviteLink
|
@ -0,0 +1,16 @@
|
||||
package dev.inmo.tgbotapi.extensions.utils.extensions.raw
|
||||
|
||||
import dev.inmo.tgbotapi.types.ChatInviteLink
|
||||
import dev.inmo.tgbotapi.types.ChatMember.abstracts.ChatMember
|
||||
import dev.inmo.tgbotapi.types.ChatMemberUpdated
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val ChatMemberUpdated.old_chat_member: ChatMember
|
||||
get() = oldChatMemberState
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val ChatMemberUpdated.new_chat_member: ChatMember
|
||||
get() = newChatMemberState
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val ChatMemberUpdated.invite_link: ChatInviteLink?
|
||||
get() = inviteLink
|
@ -1,10 +1,20 @@
|
||||
package dev.inmo.tgbotapi.extensions.utils.extensions.raw
|
||||
|
||||
import dev.inmo.tgbotapi.extensions.utils.asLocationChosenInlineResult
|
||||
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult.ChosenInlineResult
|
||||
import dev.inmo.tgbotapi.types.InlineQueryIdentifier
|
||||
import dev.inmo.tgbotapi.types.location.Location
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val ChosenInlineResult.location: Location?
|
||||
get() = asLocationChosenInlineResult() ?.location
|
||||
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val ChosenInlineResult.result_id: InlineQueryIdentifier
|
||||
get() = resultId
|
||||
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val ChosenInlineResult.inline_message_id: InlineMessageIdentifier?
|
||||
get() = inlineMessageId
|
||||
|
@ -8,3 +8,7 @@ import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val InlineQuery.location: Location?
|
||||
get() = asLocationInlineQuery() ?.location
|
||||
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val InlineQuery.chat_type: String?
|
||||
get() = chatType ?.stringified
|
||||
|
@ -35,3 +35,9 @@ val Poll.open_period: Seconds?
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val Poll.close_date: TelegramDate?
|
||||
get() = scheduledCloseInfo ?.asExactScheduledCloseInfo() ?.closeDateTime ?.toTelegramDate()
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val Poll.is_closed: Boolean
|
||||
get() = isClosed
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val Poll.is_anonymous: Boolean
|
||||
get() = isAnonymous
|
||||
|
@ -0,0 +1,12 @@
|
||||
package dev.inmo.tgbotapi.extensions.utils.extensions.raw
|
||||
|
||||
import dev.inmo.tgbotapi.types.PollIdentifier
|
||||
import dev.inmo.tgbotapi.types.polls.PollAnswer
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val PollAnswer.poll_id: PollIdentifier
|
||||
get() = pollId
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val PollAnswer.option_ids: List<Int>
|
||||
get() = chosen
|
@ -0,0 +1,20 @@
|
||||
package dev.inmo.tgbotapi.extensions.utils.extensions.raw
|
||||
|
||||
import dev.inmo.tgbotapi.types.InvoicePayload
|
||||
import dev.inmo.tgbotapi.types.ShippingOptionIdentifier
|
||||
import dev.inmo.tgbotapi.types.payments.OrderInfo
|
||||
import dev.inmo.tgbotapi.types.payments.PreCheckoutQuery
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val PreCheckoutQuery.total_amount: Long
|
||||
get() = amount
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val PreCheckoutQuery.invoice_payload: InvoicePayload
|
||||
get() = invoicePayload
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val PreCheckoutQuery.shipping_option_id: ShippingOptionIdentifier?
|
||||
get() = shippingOptionId
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val PreCheckoutQuery.order_info: OrderInfo?
|
||||
get() = orderInfo
|
@ -0,0 +1,13 @@
|
||||
package dev.inmo.tgbotapi.extensions.utils.extensions.raw
|
||||
|
||||
import dev.inmo.tgbotapi.types.InvoicePayload
|
||||
import dev.inmo.tgbotapi.types.payments.ShippingAddress
|
||||
import dev.inmo.tgbotapi.types.payments.ShippingQuery
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val ShippingQuery.invoice_payload: InvoicePayload
|
||||
get() = invoicePayload
|
||||
@RiskFeature(RawFieldsUsageWarning)
|
||||
val ShippingQuery.shipping_address: ShippingAddress
|
||||
get() = shippingAddress
|
Loading…
Reference in New Issue
Block a user