2018-12-26 08:07:24 +00:00
|
|
|
package com.github.insanusmokrassar.TelegramBotAPI.types
|
|
|
|
|
2020-06-05 08:01:19 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.BuiltinMimeTypes
|
|
|
|
|
2018-12-26 08:07:24 +00:00
|
|
|
typealias Identifier = Long
|
|
|
|
typealias MessageIdentifier = Long
|
|
|
|
typealias InlineQueryIdentifier = String
|
|
|
|
typealias UpdateIdentifier = Long
|
|
|
|
typealias MediaGroupIdentifier = String
|
|
|
|
typealias ForwardSignature = String
|
2019-04-16 09:26:02 +00:00
|
|
|
typealias ForwardSenderName = String
|
2018-12-26 08:07:24 +00:00
|
|
|
typealias AuthorSignature = ForwardSignature
|
|
|
|
typealias CallbackQueryIdentifier = String
|
|
|
|
typealias PaymentQueryIdentifier = String
|
|
|
|
typealias PreCheckoutQueryId = String
|
|
|
|
typealias ShippingQueryIdentifier = String
|
|
|
|
typealias InvoicePayload = String
|
|
|
|
typealias ShippingOptionIdentifier = String
|
|
|
|
typealias StartParameter = String
|
|
|
|
typealias InlineMessageIdentifier = String
|
2019-04-16 07:51:53 +00:00
|
|
|
typealias PollIdentifier = String
|
2019-08-12 09:15:22 +00:00
|
|
|
typealias StickerSetName = String
|
2020-01-01 16:18:51 +00:00
|
|
|
typealias FileUniqueId = String
|
2020-03-30 15:30:22 +00:00
|
|
|
typealias DiceResult = Int
|
2020-07-01 17:57:20 +00:00
|
|
|
typealias FoursquareId = String
|
|
|
|
typealias FoursquareType = String
|
2018-12-26 08:07:24 +00:00
|
|
|
|
2020-03-17 14:24:31 +00:00
|
|
|
typealias Seconds = Int
|
2020-04-24 11:51:09 +00:00
|
|
|
typealias LongSeconds = Long
|
2020-03-17 14:24:31 +00:00
|
|
|
|
2020-03-31 05:28:48 +00:00
|
|
|
val getUpdatesLimit = 1 .. 100
|
2019-01-29 00:18:07 +00:00
|
|
|
val callbackQueryAnswerLength = 0 until 200
|
2020-06-01 05:44:58 +00:00
|
|
|
val captionLength = 0 .. 1024
|
|
|
|
val textLength = 1 .. 4096
|
2018-12-26 08:07:24 +00:00
|
|
|
val userProfilePhotosRequestLimit = 0 .. 100
|
2019-01-29 00:18:07 +00:00
|
|
|
val chatTitleLength = 1 until 255
|
|
|
|
val chatDescriptionLength = 0 until 256
|
|
|
|
val inlineResultQueryIdLingth = 1 until 64
|
2019-02-26 01:45:56 +00:00
|
|
|
val allowedConnectionsLength = 1 .. 100
|
2018-12-26 08:07:24 +00:00
|
|
|
|
2019-01-29 00:18:07 +00:00
|
|
|
val invoiceTitleLimit = 1 until 32
|
|
|
|
val invoiceDescriptionLimit = 1 until 256
|
|
|
|
val invoicePayloadBytesLimit = 1 until 128
|
2018-12-26 08:07:24 +00:00
|
|
|
|
2019-04-16 07:51:53 +00:00
|
|
|
val pollOptionTextLength = 1 .. 100
|
2019-04-16 11:22:18 +00:00
|
|
|
val pollQuestionTextLength = 1 until 256
|
2019-04-16 08:16:13 +00:00
|
|
|
val pollOptionsLimit = 2 .. 10
|
2019-04-16 07:51:53 +00:00
|
|
|
|
2019-02-07 05:35:41 +00:00
|
|
|
val livePeriodLimit = 60 .. 86400
|
|
|
|
|
2019-02-07 06:14:51 +00:00
|
|
|
val inlineQueryAnswerResultsLimit = 0 .. 50
|
|
|
|
|
2020-01-01 15:56:53 +00:00
|
|
|
val customTitleLength = 0 .. 16
|
|
|
|
|
2020-03-30 15:30:22 +00:00
|
|
|
val diceResultLimit = 1 .. 6
|
|
|
|
|
2020-04-01 04:08:44 +00:00
|
|
|
val botCommandLengthLimit = 1 .. 32
|
|
|
|
val botCommandLimit = botCommandLengthLimit
|
2020-03-30 15:40:36 +00:00
|
|
|
val botCommandDescriptionLimit = 3 .. 256
|
2020-03-30 15:52:00 +00:00
|
|
|
val botCommandsLimit = 0 .. 100
|
2020-03-30 15:40:36 +00:00
|
|
|
|
2020-06-01 05:53:33 +00:00
|
|
|
val mediaCountInMediaGroup: IntRange = 2 .. 10
|
|
|
|
|
2020-04-25 03:48:23 +00:00
|
|
|
val explanationLimit = 0 .. 200
|
2020-04-24 12:46:26 +00:00
|
|
|
|
2020-04-24 13:46:47 +00:00
|
|
|
val openPeriodPollSecondsLimit = 5 .. 600
|
|
|
|
|
2020-08-19 19:17:32 +00:00
|
|
|
// Made as lazy for correct work in K/JS
|
|
|
|
val telegramInlineModeGifPermittedMimeTypes by lazy {
|
|
|
|
listOf(
|
|
|
|
BuiltinMimeTypes.Image.Jpg,
|
|
|
|
BuiltinMimeTypes.Image.Gif,
|
|
|
|
BuiltinMimeTypes.Video.MP4
|
|
|
|
)
|
|
|
|
}
|
2020-06-05 08:01:19 +00:00
|
|
|
|
2018-12-26 08:07:24 +00:00
|
|
|
const val chatIdField = "chat_id"
|
|
|
|
const val messageIdField = "message_id"
|
|
|
|
const val updateIdField = "update_id"
|
|
|
|
const val fromChatIdField = "from_chat_id"
|
|
|
|
const val disableWebPagePreviewField = "disable_web_page_preview"
|
|
|
|
const val disableNotificationField = "disable_notification"
|
|
|
|
const val replyToMessageIdField = "reply_to_message_id"
|
|
|
|
const val replyMarkupField = "reply_markup"
|
|
|
|
const val supportStreamingField = "support_streaming"
|
|
|
|
const val livePeriodField = "live_period"
|
|
|
|
const val isBotField = "is_bot"
|
|
|
|
const val firstNameField = "first_name"
|
|
|
|
const val lastNameField = "last_name"
|
|
|
|
const val languageCodeField = "language_code"
|
2020-01-23 13:08:02 +00:00
|
|
|
const val canJoinGroupsField = "can_join_groups"
|
|
|
|
const val canReadAllGroupMessagesField = "can_read_all_group_messages"
|
|
|
|
const val supportInlineQueriesField = "supports_inline_queries"
|
2018-12-26 08:07:24 +00:00
|
|
|
const val textEntitiesField = "text_entities"
|
|
|
|
const val stickerSetNameField = "set_name"
|
2019-08-12 09:41:07 +00:00
|
|
|
const val stickerSetNameFullField = "sticker_set_name"
|
2020-01-01 15:38:05 +00:00
|
|
|
const val slowModeDelayField = "slow_mode_delay"
|
2018-12-26 08:07:24 +00:00
|
|
|
const val maskPositionField = "mask_position"
|
|
|
|
const val phoneNumberField = "phone_number"
|
|
|
|
const val userIdField = "user_id"
|
|
|
|
const val containsMasksField = "contains_masks"
|
|
|
|
const val resultIdField = "result_id"
|
|
|
|
const val inlineMessageIdField = "inline_message_id"
|
|
|
|
const val callbackDataField = "callback_data"
|
2020-04-12 19:30:04 +00:00
|
|
|
const val callbackGameField = "callback_game"
|
2018-12-26 08:07:24 +00:00
|
|
|
const val callbackQueryIdField = "callback_query_id"
|
2019-02-07 06:14:51 +00:00
|
|
|
const val inlineQueryIdField = "inline_query_id"
|
2019-04-20 05:14:49 +00:00
|
|
|
const val inlineKeyboardField = "inline_keyboard"
|
2018-12-26 08:07:24 +00:00
|
|
|
const val showAlertField = "show_alert"
|
|
|
|
const val cachedTimeField = "cached_time"
|
|
|
|
const val foursquareIdField = "foursquare_id"
|
|
|
|
const val foursquareTypeField = "foursquare_type"
|
|
|
|
const val untilDateField = "until_date"
|
|
|
|
const val errorMessageField = "error_message"
|
2019-02-07 03:25:49 +00:00
|
|
|
const val messageTextField = "message_text"
|
2019-02-07 06:14:51 +00:00
|
|
|
const val isPersonalField = "is_personal"
|
|
|
|
const val nextOffsetField = "next_offset"
|
|
|
|
const val switchPmTextField = "switch_pm_text"
|
|
|
|
const val switchPmParameterField = "switch_pm_parameter"
|
2019-02-26 01:45:56 +00:00
|
|
|
const val maxAllowedConnectionsField = "max_connections"
|
|
|
|
const val allowedUpdatesField = "allowed_updates"
|
2019-02-27 06:01:04 +00:00
|
|
|
const val hasCustomCertificateField = "has_custom_certificate"
|
|
|
|
const val pendingUpdateCountField = "pending_update_count"
|
|
|
|
const val lastErrorDateField = "last_error_date"
|
|
|
|
const val lastErrorMessageField = "last_error_message"
|
2019-04-16 07:45:29 +00:00
|
|
|
const val votesCountField = "voter_count"
|
2019-04-16 07:51:53 +00:00
|
|
|
const val isClosedField = "is_closed"
|
2020-01-23 10:40:57 +00:00
|
|
|
const val totalVoterCountField = "total_voter_count"
|
2020-01-23 10:36:25 +00:00
|
|
|
const val correctOptionIdField = "correct_option_id"
|
|
|
|
const val allowsMultipleAnswersField = "allows_multiple_answers"
|
|
|
|
const val isAnonymousField = "is_anonymous"
|
2019-06-01 09:21:02 +00:00
|
|
|
const val loginUrlField = "login_url"
|
|
|
|
const val forwardTextField = "forward_text"
|
|
|
|
const val botUsernameField = "bot_username"
|
2019-06-01 09:31:48 +00:00
|
|
|
const val switchInlineQueryCurrentChatField = "switch_inline_query_current_chat"
|
2019-06-02 14:10:04 +00:00
|
|
|
const val switchInlineQueryField = "switch_inline_query"
|
2019-08-12 07:25:55 +00:00
|
|
|
const val isAnimatedField = "is_animated"
|
2019-08-12 09:41:07 +00:00
|
|
|
const val inviteLinkField = "invite_link"
|
|
|
|
const val pinnedMessageField = "pinned_message"
|
2020-01-01 15:45:39 +00:00
|
|
|
const val customTitleField = "custom_title"
|
2020-01-23 11:17:24 +00:00
|
|
|
const val optionIdsField = "option_ids"
|
2019-06-01 09:21:02 +00:00
|
|
|
|
2020-01-23 12:06:22 +00:00
|
|
|
const val requestContactField = "request_contact"
|
|
|
|
const val requestLocationField = "request_location"
|
|
|
|
const val requestPollField = "request_poll"
|
|
|
|
|
2019-06-01 09:21:02 +00:00
|
|
|
|
|
|
|
const val requestWriteAccessField = "request_write_access"
|
2018-12-26 08:07:24 +00:00
|
|
|
|
2019-02-07 04:32:32 +00:00
|
|
|
|
2018-12-26 08:07:24 +00:00
|
|
|
const val photoUrlField = "photo_url"
|
|
|
|
const val photoSizeField = "photo_size"
|
|
|
|
const val photoFileIdField = "photo_file_id"
|
2019-02-07 04:32:32 +00:00
|
|
|
const val photoWidthField = "photo_width"
|
|
|
|
const val photoHeightField = "photo_height"
|
|
|
|
|
2018-12-26 08:07:24 +00:00
|
|
|
const val gifUrlField = "gif_url"
|
|
|
|
const val gifFileIdField = "gif_file_id"
|
2019-02-07 04:15:16 +00:00
|
|
|
const val gifWidthField = "gif_width"
|
|
|
|
const val gifHeightField = "gif_height"
|
|
|
|
const val gifDurationField = "gif_duration"
|
2019-02-07 04:32:32 +00:00
|
|
|
|
2019-02-07 04:15:16 +00:00
|
|
|
const val mpeg4GifUrlField = "mpeg4_url"
|
|
|
|
const val mpeg4GifFileIdField = "mpeg4_file_id"
|
|
|
|
const val mpeg4GifWidthField = "mpeg4_width"
|
|
|
|
const val mpeg4GifHeightField = "mpeg4_height"
|
|
|
|
const val mpeg4GifDurationField = "mpeg4_duration"
|
2019-02-07 04:32:32 +00:00
|
|
|
|
|
|
|
const val videoUrlField = "video_url"
|
|
|
|
const val videoFileIdField = "video_file_id"
|
|
|
|
const val videoWidthField = "video_width"
|
|
|
|
const val videoHeightField = "video_height"
|
|
|
|
const val videoDurationField = "video_duration"
|
|
|
|
|
2019-02-07 04:47:08 +00:00
|
|
|
const val audioUrlField = "audio_url"
|
|
|
|
const val audioFileIdField = "audio_file_id"
|
|
|
|
const val audioDurationField = "audio_duration"
|
|
|
|
|
2019-02-07 05:10:15 +00:00
|
|
|
const val voiceUrlField = "voice_url"
|
|
|
|
const val voiceFileIdField = "voice_file_id"
|
|
|
|
const val voiceDurationField = "voice_duration"
|
|
|
|
|
2019-02-07 05:28:31 +00:00
|
|
|
const val documentUrlField = "document_url"
|
|
|
|
const val documentFileIdField = "document_file_id"
|
|
|
|
|
2019-02-07 06:04:03 +00:00
|
|
|
const val stickerFileIdField = "sticker_file_id"
|
|
|
|
|
2019-02-07 04:32:32 +00:00
|
|
|
const val gameShortNameField = "game_short_name"
|
|
|
|
|
2018-12-26 08:07:24 +00:00
|
|
|
const val thumbUrlField = "thumb_url"
|
2020-06-05 08:01:19 +00:00
|
|
|
const val thumbMimeTypeField = "thumb_mime_type"
|
2018-12-26 08:07:24 +00:00
|
|
|
const val thumbWidthField = "thumb_width"
|
|
|
|
const val thumbHeightField = "thumb_height"
|
2019-02-07 04:32:32 +00:00
|
|
|
|
2018-12-26 08:07:24 +00:00
|
|
|
const val inputMessageContentField = "input_message_content"
|
|
|
|
const val hideUrlField = "hide_url"
|
2019-02-07 04:32:32 +00:00
|
|
|
|
2020-03-30 15:40:36 +00:00
|
|
|
const val botCommandField = "command"
|
2020-03-30 15:52:00 +00:00
|
|
|
const val botCommandsField = "commands"
|
2018-12-26 08:07:24 +00:00
|
|
|
|
2019-04-16 09:10:20 +00:00
|
|
|
const val isMemberField = "is_member"
|
2018-12-26 08:07:24 +00:00
|
|
|
const val canSendMessagesField = "can_send_messages"
|
|
|
|
const val canSendMediaMessagesField = "can_send_media_messages"
|
|
|
|
const val canSendOtherMessagesField = "can_send_other_messages"
|
2019-08-12 07:46:16 +00:00
|
|
|
const val canSendPollsField = "can_send_polls"
|
2018-12-26 08:07:24 +00:00
|
|
|
const val canAddWebPagePreviewsField = "can_add_web_page_previews"
|
2019-08-12 09:41:07 +00:00
|
|
|
const val canSetStickerSetField = "can_set_sticker_set"
|
2018-12-26 08:07:24 +00:00
|
|
|
|
|
|
|
const val canBeEditedField = "can_be_edited"
|
|
|
|
const val canChangeInfoField = "can_change_info"
|
|
|
|
const val canPostMessagesField = "can_post_messages"
|
|
|
|
const val canEditMessagesField = "can_edit_messages"
|
|
|
|
const val canDeleteMessagesField = "can_delete_messages"
|
|
|
|
const val canInviteUsersField = "can_invite_users"
|
|
|
|
const val canRestrictMembersField = "can_restrict_members"
|
|
|
|
const val canPinMessagesField = "can_pin_messages"
|
|
|
|
const val canPromoteMembersField = "can_promote_members"
|
|
|
|
const val pngStickerField = "png_sticker"
|
2020-03-30 16:03:59 +00:00
|
|
|
const val tgsStickerField = "tgs_sticker"
|
2018-12-26 08:07:24 +00:00
|
|
|
|
|
|
|
const val okField = "ok"
|
|
|
|
const val captionField = "caption"
|
2020-04-24 11:51:09 +00:00
|
|
|
const val explanationField = "explanation"
|
2018-12-26 08:07:24 +00:00
|
|
|
const val idField = "id"
|
2020-01-23 11:17:24 +00:00
|
|
|
const val pollIdField = "poll_id"
|
2018-12-26 08:07:24 +00:00
|
|
|
const val textField = "text"
|
|
|
|
const val thumbField = "thumb"
|
|
|
|
const val emojiField = "emoji"
|
|
|
|
const val emojisField = "emojis"
|
|
|
|
const val titleField = "title"
|
|
|
|
const val descriptionField = "description"
|
|
|
|
const val performerField = "performer"
|
|
|
|
const val durationField = "duration"
|
|
|
|
const val widthField = "width"
|
|
|
|
const val heightField = "height"
|
|
|
|
const val lengthField = "length"
|
|
|
|
const val latitudeField = "latitude"
|
|
|
|
const val longitudeField = "longitude"
|
|
|
|
const val fromField = "from"
|
|
|
|
const val userField = "user"
|
|
|
|
const val dateField = "date"
|
|
|
|
const val chatField = "chat"
|
|
|
|
const val usernameField = "username"
|
|
|
|
const val nameField = "name"
|
|
|
|
const val emailField = "email"
|
|
|
|
const val locationField = "location"
|
|
|
|
const val queryField = "query"
|
|
|
|
const val offsetField = "offset"
|
|
|
|
const val limitField = "limit"
|
|
|
|
const val stickersField = "stickers"
|
|
|
|
const val stickerField = "sticker"
|
|
|
|
const val urlField = "url"
|
|
|
|
const val addressField = "address"
|
|
|
|
const val actionField = "action"
|
|
|
|
const val positionField = "position"
|
|
|
|
const val labelField = "label"
|
|
|
|
const val amountField = "amount"
|
|
|
|
const val pricesField = "prices"
|
|
|
|
const val payloadField = "payload"
|
2019-02-07 06:01:09 +00:00
|
|
|
const val vcardField = "vcard"
|
2019-02-07 06:14:51 +00:00
|
|
|
const val resultsField = "results"
|
2019-02-26 01:45:56 +00:00
|
|
|
const val certificateField = "certificate"
|
2019-04-16 07:51:53 +00:00
|
|
|
const val questionField = "question"
|
|
|
|
const val optionsField = "options"
|
2019-06-02 14:10:04 +00:00
|
|
|
const val payField = "pay"
|
2019-08-12 07:46:16 +00:00
|
|
|
const val permissionsField = "permissions"
|
2019-08-12 09:41:07 +00:00
|
|
|
const val typeField = "type"
|
2020-03-30 15:30:22 +00:00
|
|
|
const val valueField = "value"
|
2018-12-26 08:07:24 +00:00
|
|
|
|
|
|
|
const val pointField = "point"
|
|
|
|
const val xShiftField = "x_shift"
|
|
|
|
const val yShiftField = "y_shift"
|
2019-04-13 02:15:25 +00:00
|
|
|
const val scaleField = "scale"
|
2018-12-26 08:07:24 +00:00
|
|
|
|
2020-04-24 11:51:09 +00:00
|
|
|
const val explanationEntitiesField = "explanation_entities"
|
2020-04-24 12:46:26 +00:00
|
|
|
const val explanationParseModeField = "explanation_parse_mode"
|
2020-04-24 11:51:09 +00:00
|
|
|
const val openPeriodField = "open_period"
|
|
|
|
const val closeDateField = "close_date"
|
2018-12-26 08:07:24 +00:00
|
|
|
|
2020-01-01 16:18:51 +00:00
|
|
|
const val smallFileIdField = "small_file_id"
|
|
|
|
const val bigFileIdField = "big_file_id"
|
|
|
|
const val smallFileUniqueIdField = "small_file_unique_id"
|
|
|
|
const val bigFileUniqueIdField = "big_file_unique_id"
|
|
|
|
|
2020-01-01 16:26:19 +00:00
|
|
|
const val fileUniqueIdField = "file_unique_id"
|
|
|
|
|
2020-01-01 16:18:51 +00:00
|
|
|
|
2018-12-26 08:07:24 +00:00
|
|
|
const val currencyField = "currency"
|
|
|
|
const val startParameterField = "start_parameter"
|
|
|
|
const val totalAmountField = "total_amount"
|
|
|
|
const val invoicePayloadField = "invoice_payload"
|
|
|
|
const val shippingOptionIdField = "shipping_option_id"
|
|
|
|
const val shippingQueryIdField = "shipping_query_id"
|
|
|
|
const val preCheckoutQueryIdField = "pre_checkout_query_id"
|
|
|
|
const val shippingOptionsField = "shipping_options"
|
|
|
|
const val countryCodeField = "country_code"
|
|
|
|
const val stateField = "state"
|
|
|
|
const val cityField = "city"
|
|
|
|
const val firstStreetLineField = "street_line1"
|
|
|
|
const val secondStreetLineField = "street_line2"
|
|
|
|
const val postCodeField = "post_code"
|
|
|
|
const val shippingAddressField = "shipping_address"
|
|
|
|
const val orderInfoField = "order_info"
|
|
|
|
const val telegramPaymentChargeIdField = "telegram_payment_charge_id"
|
|
|
|
const val providerPaymentChargeIdField = "provider_payment_charge_id"
|
|
|
|
const val providerTokenField = "provider_token"
|
|
|
|
const val providerDataField = "provider_data"
|
|
|
|
|
|
|
|
const val requireNameField = "need_name"
|
|
|
|
const val requirePhoneNumberField = "need_phone_number"
|
|
|
|
const val requireEmailField = "need_email"
|
|
|
|
const val requireShippingAddressField = "need_shipping_address"
|
|
|
|
|
|
|
|
const val shouldSendPhoneNumberToProviderField = "send_phone_number_to_provider"
|
|
|
|
const val shouldSendEmailToProviderField = "send_email_to_provider"
|
|
|
|
|
|
|
|
const val priceDependOnShipAddressField = "is_flexible"
|
|
|
|
|
|
|
|
const val documentField = "document"
|
|
|
|
const val photoField = "photo"
|
|
|
|
const val audioField = "audio"
|
|
|
|
const val videoField = "video"
|
|
|
|
const val animationField = "animation"
|
|
|
|
const val voiceField = "voice"
|
|
|
|
const val videoNoteField = "video_note"
|
|
|
|
const val mediaField = "media"
|
|
|
|
|
|
|
|
const val disableEditMessageField = "disable_edit_message"
|
|
|
|
const val scoreField = "score"
|
|
|
|
const val forceField = "force"
|
2020-01-23 10:36:25 +00:00
|
|
|
|
|
|
|
const val regularPollType = "regular"
|
|
|
|
const val quizPollType = "quiz"
|