@grammyjs/types
Advanced tools
Comparing version 2.7.2 to 2.8.0
@@ -19,3 +19,3 @@ export interface ApiError { | ||
/** Contains information about why a request was unsuccessful. */ | ||
/** Describes why a request was unsuccessful. */ | ||
export interface ResponseParameters { | ||
@@ -22,0 +22,0 @@ /** The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */ |
@@ -16,3 +16,3 @@ import { Chat, User } from "./manage"; | ||
offset: string; | ||
/** Type of the chat, from which the inline query was sent. Can be either "sender" for a private chat with the inline query sender, "private", "group", "supergroup", or "channel". The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat */ | ||
/** Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat */ | ||
chat_type?: "sender" | Chat["type"]; | ||
@@ -140,3 +140,3 @@ /** Sender location, only for bots that request user location */ | ||
thumb_url: string; | ||
/** MIME type of the thumbnail, must be one of "image/jpeg", "image/gif", or "video/mp4". Defaults to "image/jpeg" */ | ||
/** MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” */ | ||
thumb_mime_type?: "image/jpeg" | "image/gif" | "video/mp4"; | ||
@@ -161,3 +161,3 @@ /** Title for the result */ | ||
id: string; | ||
/** A valid URL for the MP4 file. File size must not exceed 1MB */ | ||
/** A valid URL for the MPEG4 file. File size must not exceed 1MB */ | ||
mpeg4_url: string; | ||
@@ -172,3 +172,3 @@ /** Video width */ | ||
thumb_url: string; | ||
/** MIME type of the thumbnail, must be one of "image/jpeg", "image/gif", or "video/mp4". Defaults to "image/jpeg" */ | ||
/** MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” */ | ||
thumb_mime_type?: "image/jpeg" | "image/gif" | "video/mp4"; | ||
@@ -197,3 +197,3 @@ /** Title for the result */ | ||
video_url: string; | ||
/** Mime type of the content of video url, "text/html" or "video/mp4" */ | ||
/** MIME type of the content of the video URL, “text/html” or “video/mp4” */ | ||
mime_type: "text/html" | "video/mp4"; | ||
@@ -294,3 +294,3 @@ /** URL of the thumbnail (JPEG only) for the video */ | ||
document_url: string; | ||
/** Mime type of the content of the file, either “application/pdf” or “application/zip” */ | ||
/** MIME type of the content of the file, either “application/pdf” or “application/zip” */ | ||
mime_type: "application/pdf" | "application/zip"; | ||
@@ -331,3 +331,3 @@ /** Short description of the result */ | ||
heading?: number; | ||
/** Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */ | ||
/** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */ | ||
proximity_alert_radius?: number; | ||
@@ -364,3 +364,3 @@ /** Inline keyboard attached to the message */ | ||
foursquare_id?: string; | ||
/** Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) */ | ||
/** Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */ | ||
foursquare_type?: string; | ||
@@ -475,3 +475,3 @@ /** Google Places identifier of the venue */ | ||
id: string; | ||
/** A valid file identifier for the MP4 file */ | ||
/** A valid file identifier for the MPEG4 file */ | ||
mpeg4_file_id: string; | ||
@@ -655,3 +655,3 @@ /** Title for the result */ | ||
foursquare_id?: string; | ||
/** Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) */ | ||
/** Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */ | ||
foursquare_type?: string; | ||
@@ -684,3 +684,3 @@ /** Google Places identifier of the venue */ | ||
payload: string; | ||
/** Payment provider token, obtained via Botfather */ | ||
/** Payment provider token, obtained via BotFather */ | ||
provider_token: string; | ||
@@ -695,7 +695,7 @@ /** Three-letter ISO 4217 currency code, see more on currencies */ | ||
suggested_tip_amounts?: number[]; | ||
/** An object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. */ | ||
/** Data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. */ | ||
provider_data?: string; | ||
/** URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. */ | ||
/** URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. */ | ||
photo_url?: string; | ||
/** Photo size */ | ||
/** Photo size in bytes */ | ||
photo_size?: number; | ||
@@ -714,5 +714,5 @@ /** Photo width */ | ||
need_shipping_address?: boolean; | ||
/** Pass True, if user's phone number should be sent to provider */ | ||
/** Pass True, if the user's phone number should be sent to provider */ | ||
send_phone_number_to_provider?: boolean; | ||
/** Pass True, if user's email address should be sent to provider */ | ||
/** Pass True, if the user's email address should be sent to provider */ | ||
send_email_to_provider?: boolean; | ||
@@ -725,3 +725,3 @@ /** Pass True, if the final price depends on the shipping method */ | ||
Note: It is necessary to enable inline feedback via @Botfather in order to receive these objects in updates. */ | ||
Note: It is necessary to enable inline feedback via @BotFather in order to receive these objects in updates. */ | ||
export interface ChosenInlineResult { | ||
@@ -728,0 +728,0 @@ /** The unique identifier for the result that was chosen */ |
import { Location, Message, PhotoSize } from "./message"; | ||
import { Update } from "./update"; | ||
/** Contains information about the current status of a webhook. */ | ||
/** Describes the current status of a webhook. */ | ||
export interface WebhookInfo { | ||
@@ -20,3 +20,3 @@ /** Webhook URL, may be empty if webhook is not set up */ | ||
last_synchronization_error_date?: number; | ||
/** Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */ | ||
/** The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */ | ||
max_connections: number; | ||
@@ -41,2 +41,6 @@ /** A list of update types the bot is subscribed to. Defaults to all update types except chat_member */ | ||
language_code?: string; | ||
/** True, if this user is a Telegram Premium user */ | ||
is_premium?: true; | ||
/** True, if this user added the bot to the attachment menu */ | ||
added_to_attachment_menu?: true; | ||
} | ||
@@ -60,3 +64,3 @@ | ||
interface AbstractChat { | ||
/** Type of chat, can be either "private", "group", "supergroup" or "channel" */ | ||
/** Type of chat, can be either “private”, “group”, “supergroup” or “channel” */ | ||
type: string; | ||
@@ -94,5 +98,3 @@ /** Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */ | ||
export interface SupergroupChat | ||
extends AbstractChat, | ||
UserNameChat, | ||
TitleChat { | ||
extends AbstractChat, UserNameChat, TitleChat { | ||
type: "supergroup"; | ||
@@ -110,2 +112,6 @@ } | ||
photo?: ChatPhoto; | ||
/** True, if users need to join the supergroup before they can send messages. Returned only in getChat. */ | ||
join_to_send_messages?: true; | ||
/** True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat. */ | ||
join_by_request?: true; | ||
/** The most recent pinned message (by sending date). Returned only in getChat. */ | ||
@@ -150,5 +156,3 @@ pinned_message?: Message; | ||
export interface SupergroupGetChat | ||
extends SupergroupChat, | ||
MultiUserGetChat, | ||
LargeGetChat { | ||
extends SupergroupChat, MultiUserGetChat, LargeGetChat { | ||
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. */ | ||
@@ -215,3 +219,3 @@ slow_mode_delay?: number; | ||
expire_date?: number; | ||
/** Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */ | ||
/** The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */ | ||
member_limit?: number; | ||
@@ -265,3 +269,3 @@ /** Number of pending join requests created using this link */ | ||
export interface ChatMemberOwner { | ||
/** The member's status in the chat, always "creator" */ | ||
/** The member's status in the chat, always “creator” */ | ||
status: "creator"; | ||
@@ -278,3 +282,3 @@ /** Information about the user */ | ||
export interface ChatMemberAdministrator { | ||
/** The member's status in the chat, always "administrator" */ | ||
/** The member's status in the chat, always “administrator” */ | ||
status: "administrator"; | ||
@@ -313,3 +317,3 @@ /** Information about the user */ | ||
export interface ChatMemberMember { | ||
/** The member's status in the chat, always "member" */ | ||
/** The member's status in the chat, always “member” */ | ||
status: "member"; | ||
@@ -322,3 +326,3 @@ /** Information about the user */ | ||
export interface ChatMemberRestricted { | ||
/** The member's status in the chat, always "restricted" */ | ||
/** The member's status in the chat, always “restricted” */ | ||
status: "restricted"; | ||
@@ -351,3 +355,3 @@ /** Information about the user */ | ||
export interface ChatMemberLeft { | ||
/** The member's status in the chat, always "left" */ | ||
/** The member's status in the chat, always “left” */ | ||
status: "left"; | ||
@@ -360,3 +364,3 @@ /** Information about the user */ | ||
export interface ChatMemberBanned { | ||
/** The member's status in the chat, always "kicked" */ | ||
/** The member's status in the chat, always “kicked” */ | ||
status: "kicked"; | ||
@@ -441,3 +445,3 @@ /** Information about the user */ | ||
file_unique_id: string; | ||
/** File size in bytes, if known */ | ||
/** File size in bytes */ | ||
file_size?: number; | ||
@@ -444,0 +448,0 @@ /** File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */ |
@@ -16,3 +16,3 @@ import { User } from "./manage"; | ||
export interface UrlButton extends AbstractInlineKeyboardButton { | ||
/** HTTP or tg:// url to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings. */ | ||
/** HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings. */ | ||
url: string; | ||
@@ -29,3 +29,3 @@ } | ||
export interface LoginButton extends AbstractInlineKeyboardButton { | ||
/** An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. */ | ||
/** An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. */ | ||
login_url: LoginUrl; | ||
@@ -103,3 +103,3 @@ } | ||
chat_instance: string; | ||
/** Data associated with the callback button. Be aware that the message, which originated the query, can contain no callback buttons with this data. */ | ||
/** Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data. */ | ||
data?: string; | ||
@@ -182,3 +182,3 @@ /** Short name of a Game to be returned, serves as the unique identifier for the game */ | ||
The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions — without any extra work for the user. */ | ||
The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user. */ | ||
export interface ForceReply { | ||
@@ -193,3 +193,3 @@ /** Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' */ | ||
/** Contains information about a Web App. */ | ||
/** Describes a Web App. */ | ||
export interface WebAppInfo { | ||
@@ -196,0 +196,0 @@ /** An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps */ |
114
message.d.ts
import { InlineKeyboardMarkup } from "./markup"; | ||
import { Chat, User } from "./manage"; | ||
import { Chat, File, User } from "./manage"; | ||
import { PassportData } from "./passport"; | ||
@@ -50,3 +50,3 @@ import { Invoice, SuccessfulPayment } from "./payment"; | ||
export interface CaptionableMessage extends CommonMessage { | ||
/** Caption for the animation, audio, document, photo, video or voice, 0-1024 characters */ | ||
/** Caption for the animation, audio, document, photo, video or voice */ | ||
caption?: string; | ||
@@ -76,39 +76,55 @@ /** For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */ | ||
export type VenueMessage = LocationMessage & MsgWith<"venue">; | ||
export type NewChatMembersMessage = ServiceMessage & | ||
MsgWith<"new_chat_members">; | ||
export type LeftChatMemberMessage = ServiceMessage & | ||
MsgWith<"left_chat_member">; | ||
export type NewChatMembersMessage = | ||
& ServiceMessage | ||
& MsgWith<"new_chat_members">; | ||
export type LeftChatMemberMessage = | ||
& ServiceMessage | ||
& MsgWith<"left_chat_member">; | ||
export type NewChatTitleMessage = ServiceMessage & MsgWith<"new_chat_title">; | ||
export type NewChatPhotoMessage = ServiceMessage & MsgWith<"new_chat_photo">; | ||
export type DeleteChatPhotoMessage = ServiceMessage & | ||
MsgWith<"delete_chat_photo">; | ||
export type GroupChatCreatedMessage = ServiceMessage & | ||
MsgWith<"group_chat_created">; | ||
export type SupergroupChatCreated = ServiceMessage & | ||
MsgWith<"supergroup_chat_created">; | ||
export type ChannelChatCreatedMessage = ServiceMessage & | ||
MsgWith<"channel_chat_created">; | ||
export type MessageAutoDeleteTimerChangedMessage = ServiceMessage & | ||
MsgWith<"message_auto_delete_timer_changed">; | ||
export type MigrateToChatIdMessage = ServiceMessage & | ||
MsgWith<"migrate_to_chat_id">; | ||
export type MigrateFromChatIdMessage = ServiceMessage & | ||
MsgWith<"migrate_from_chat_id">; | ||
export type DeleteChatPhotoMessage = | ||
& ServiceMessage | ||
& MsgWith<"delete_chat_photo">; | ||
export type GroupChatCreatedMessage = | ||
& ServiceMessage | ||
& MsgWith<"group_chat_created">; | ||
export type SupergroupChatCreated = | ||
& ServiceMessage | ||
& MsgWith<"supergroup_chat_created">; | ||
export type ChannelChatCreatedMessage = | ||
& ServiceMessage | ||
& MsgWith<"channel_chat_created">; | ||
export type MessageAutoDeleteTimerChangedMessage = | ||
& ServiceMessage | ||
& MsgWith<"message_auto_delete_timer_changed">; | ||
export type MigrateToChatIdMessage = | ||
& ServiceMessage | ||
& MsgWith<"migrate_to_chat_id">; | ||
export type MigrateFromChatIdMessage = | ||
& ServiceMessage | ||
& MsgWith<"migrate_from_chat_id">; | ||
export type PinnedMessageMessage = ServiceMessage & MsgWith<"pinned_message">; | ||
export type InvoiceMessage = ServiceMessage & MsgWith<"invoice">; | ||
export type SuccessfulPaymentMessage = ServiceMessage & | ||
MsgWith<"successful_payment">; | ||
export type ConnectedWebsiteMessage = ServiceMessage & | ||
MsgWith<"connected_website">; | ||
export type SuccessfulPaymentMessage = | ||
& ServiceMessage | ||
& MsgWith<"successful_payment">; | ||
export type ConnectedWebsiteMessage = | ||
& ServiceMessage | ||
& MsgWith<"connected_website">; | ||
export type PassportDataMessage = ServiceMessage & MsgWith<"passport_data">; | ||
export type ProximityAlertTriggeredMessage = ServiceMessage & | ||
MsgWith<"proximity_alert_triggered">; | ||
export type VideoChatScheduledMessage = ServiceMessage & | ||
MsgWith<"video_chat_scheduled">; | ||
export type VideoChatStartedMessage = ServiceMessage & | ||
MsgWith<"video_chat_started">; | ||
export type VideoChatEndedMessage = ServiceMessage & | ||
MsgWith<"video_chat_ended">; | ||
export type VideoChatParticipantsInvitedMessage = ServiceMessage & | ||
MsgWith<"video_chat_participants_invited">; | ||
export type ProximityAlertTriggeredMessage = | ||
& ServiceMessage | ||
& MsgWith<"proximity_alert_triggered">; | ||
export type VideoChatScheduledMessage = | ||
& ServiceMessage | ||
& MsgWith<"video_chat_scheduled">; | ||
export type VideoChatStartedMessage = | ||
& ServiceMessage | ||
& MsgWith<"video_chat_started">; | ||
export type VideoChatEndedMessage = | ||
& ServiceMessage | ||
& MsgWith<"video_chat_ended">; | ||
export type VideoChatParticipantsInvitedMessage = | ||
& ServiceMessage | ||
& MsgWith<"video_chat_participants_invited">; | ||
export type WebAppDataMessage = ServiceMessage & MsgWith<"web_app_data">; | ||
@@ -120,3 +136,3 @@ } | ||
export interface Message extends Message.MediaMessage { | ||
/** For text messages, the actual UTF-8 text of the message, 0-4096 characters */ | ||
/** For text messages, the actual UTF-8 text of the message */ | ||
text?: string; | ||
@@ -206,3 +222,3 @@ /** For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text */ | ||
/** Contains information about an inline message sent by a Web App on behalf of a user. */ | ||
/** Describes an inline message sent by a Web App on behalf of a user. */ | ||
export interface SentWebAppMessage { | ||
@@ -218,3 +234,3 @@ /** Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. */ | ||
Message entities can be nested, providing following restrictions are met: | ||
- If two entities have common characters then one of them is fully contained inside another. | ||
- If two entities have common characters, then one of them is fully contained inside another. | ||
- bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code. | ||
@@ -307,3 +323,3 @@ - All other entities can't contain each other. | ||
interface AbstractMessageEntity { | ||
/** Type of the entity. Currently, can be "mention" (@username), "hashtag" (#hashtag), "cashtag" ($USD), "bot_command" (/start@jobs_bot), "url" (https://telegram.org), "email" (do-not-reply@telegram.org), "phone_number" (+1-212-555-0123), "bold" (bold text), "italic" (italic text), "underline" (underlined text), "strikethrough" (strikethrough text), "spoiler" (spoiler message), "code" (monowidth string), "pre" (monowidth block), "text_link" (for clickable text URLs), "text_mention" (for users without usernames) */ | ||
/** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames) */ | ||
type: string; | ||
@@ -333,3 +349,3 @@ /** Offset in UTF-16 code units to the start of the entity */ | ||
type: "text_link"; | ||
/** For "text_link" only, url that will be opened after user taps on the text */ | ||
/** For “text_link” only, URL that will be opened after user taps on the text */ | ||
url: string; | ||
@@ -339,3 +355,3 @@ } | ||
type: "text_mention"; | ||
/** For "text_mention" only, the mentioned user */ | ||
/** For “text_mention” only, the mentioned user */ | ||
user: User; | ||
@@ -345,3 +361,3 @@ } | ||
type: "pre"; | ||
/** For "pre" only, the programming language of the entity text */ | ||
/** For “pre” only, the programming language of the entity text */ | ||
language?: string; | ||
@@ -448,3 +464,3 @@ } | ||
file_name?: string; | ||
/** Mime type of a file as defined by sender */ | ||
/** MIME type of the file as defined by sender */ | ||
mime_type?: string; | ||
@@ -539,3 +555,3 @@ /** File size in bytes */ | ||
is_anonymous: boolean; | ||
/** Poll type, currently can be "regular" or "quiz" */ | ||
/** Poll type, currently can be “regular” or “quiz” */ | ||
type: "regular" | "quiz"; | ||
@@ -568,3 +584,3 @@ /** True, if the poll allows multiple answers */ | ||
heading?: number; | ||
/** Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */ | ||
/** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */ | ||
proximity_alert_radius?: number; | ||
@@ -583,3 +599,3 @@ } | ||
foursquare_id?: string; | ||
/** Foursquare type of the venue. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) */ | ||
/** Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */ | ||
foursquare_type?: string; | ||
@@ -629,7 +645,7 @@ /** Google Places identifier of the venue */ | ||
/** Contains data sent from a Web App to the bot. */ | ||
/** Describes data sent from a Web App to the bot. */ | ||
export interface WebAppData { | ||
/** The data. Be aware that a bad client can send arbitrary data in this field. */ | ||
data: string; | ||
/** Text of the web_app keyboard button, from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. */ | ||
/** Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. */ | ||
button_text: string; | ||
@@ -658,2 +674,4 @@ } | ||
set_name?: string; | ||
/** Premium animation for the sticker, if the sticker is premium */ | ||
premium_animation?: File; | ||
/** For mask stickers, the position where the mask should be placed */ | ||
@@ -685,3 +703,3 @@ mask_position?: MaskPosition; | ||
export interface MaskPosition { | ||
/** The part of the face relative to which the mask should be placed. One of "forehead", "eyes", "mouth", or "chin". */ | ||
/** The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. */ | ||
point: "forehead" | "eyes" | "mouth" | "chin"; | ||
@@ -688,0 +706,0 @@ /** Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. */ |
{ | ||
"name": "@grammyjs/types", | ||
"version": "2.7.2", | ||
"version": "2.8.0", | ||
"description": "Telegram Bot API type declarations for grammY", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
/** Contains information about Telegram Passport data shared with the bot by the user. */ | ||
/** Describes Telegram Passport data shared with the bot by the user. */ | ||
export interface PassportData { | ||
@@ -21,5 +21,5 @@ /** Array with information about documents and other Telegram Passport elements that was shared with the bot */ | ||
/** Contains information about documents or other Telegram Passport elements shared with the bot by the user. */ | ||
/** Describes documents or other Telegram Passport elements shared with the bot by the user. */ | ||
export interface EncryptedPassportElement { | ||
/** Element type. One of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration", "phone_number", "email". */ | ||
/** Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”. */ | ||
type: | ||
@@ -39,17 +39,17 @@ | "personal_details" | ||
| "email"; | ||
/** Base64-encoded encrypted Telegram Passport element data provided by the user, available for "personal_details", "passport", "driver_license", "identity_card", "internal_passport" and "address" types. Can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
/** Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
data?: string; | ||
/** User's verified phone number, available only for "phone_number" type */ | ||
/** User's verified phone number, available only for “phone_number” type */ | ||
phone_number?: string; | ||
/** User's verified email address, available only for "email" type */ | ||
/** User's verified email address, available only for “email” type */ | ||
email?: string; | ||
/** Array of encrypted files with documents provided by the user, available for "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
/** Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
files?: PassportFile[]; | ||
/** Encrypted file with the front side of the document, provided by the user. Available for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
/** Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
front_side?: PassportFile; | ||
/** Encrypted file with the reverse side of the document, provided by the user. Available for "driver_license" and "identity_card". The file can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
/** Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
reverse_side?: PassportFile; | ||
/** Encrypted file with the selfie of the user holding a document, provided by the user; available for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
/** Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
selfie?: PassportFile; | ||
/** Array of encrypted files with translated versions of documents provided by the user. Available if requested for "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
/** Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. */ | ||
translation?: PassportFile[]; | ||
@@ -60,3 +60,3 @@ /** Base64-encoded element hash for using in PassportElementErrorUnspecified */ | ||
/** Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes. */ | ||
/** Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes. */ | ||
export interface EncryptedCredentials { | ||
@@ -97,3 +97,3 @@ /** Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication */ | ||
source: "data"; | ||
/** The section of the user's Telegram Passport which has the error, one of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address" */ | ||
/** The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address” */ | ||
type: | ||
@@ -118,3 +118,3 @@ | "personal_details" | ||
source: "front_side"; | ||
/** The section of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport" */ | ||
/** The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” */ | ||
type: "passport" | "driver_license" | "identity_card" | "internal_passport"; | ||
@@ -131,3 +131,3 @@ /** Base64-encoded hash of the file with the front side of the document */ | ||
source: "reverse_side"; | ||
/** The section of the user's Telegram Passport which has the issue, one of "driver_license", "identity_card" */ | ||
/** The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card” */ | ||
type: "driver_license" | "identity_card"; | ||
@@ -144,3 +144,3 @@ /** Base64-encoded hash of the file with the reverse side of the document */ | ||
source: "selfie"; | ||
/** The section of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport" */ | ||
/** The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” */ | ||
type: "passport" | "driver_license" | "identity_card" | "internal_passport"; | ||
@@ -157,3 +157,3 @@ /** Base64-encoded hash of the file with the selfie */ | ||
source: "file"; | ||
/** The section of the user's Telegram Passport which has the issue, one of "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration" */ | ||
/** The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” */ | ||
type: | ||
@@ -175,3 +175,3 @@ | "utility_bill" | ||
source: "files"; | ||
/** The section of the user's Telegram Passport which has the issue, one of "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration" */ | ||
/** The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” */ | ||
type: | ||
@@ -193,3 +193,3 @@ | "utility_bill" | ||
source: "translation_file"; | ||
/** Type of element of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration" */ | ||
/** Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” */ | ||
type: | ||
@@ -215,3 +215,3 @@ | "passport" | ||
source: "translation_files"; | ||
/** Type of element of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration" */ | ||
/** Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” */ | ||
type: | ||
@@ -218,0 +218,0 @@ | "passport" |
@@ -27,3 +27,3 @@ import { User } from "./manage"; | ||
export interface ShippingAddress { | ||
/** ISO 3166-1 alpha-2 country code */ | ||
/** Two-letter ISO 3166-1 alpha-2 country code */ | ||
country_code: string; | ||
@@ -74,3 +74,3 @@ /** State, if applicable */ | ||
shipping_option_id?: string; | ||
/** Order info provided by the user */ | ||
/** Order information provided by the user */ | ||
order_info?: OrderInfo; | ||
@@ -109,4 +109,4 @@ /** Telegram payment identifier */ | ||
shipping_option_id?: string; | ||
/** Order info provided by the user */ | ||
/** Order information provided by the user */ | ||
order_info?: OrderInfo; | ||
} |
@@ -76,1 +76,17 @@ # Telegram Bot API types for grammY | ||
grammY then imports the proxy type called `InputProxyType` and parametrises it with its version of `InputFile`. | ||
## Differences to the Bot API | ||
Some documentation strings are intentionally different from what is written on the website. | ||
The actual type definitions themselves are never different. | ||
1. No formatting. | ||
We do not leverage the markdown capabilities of JSDoc for the sake of easier copying and thus reduced maintenance efforts. | ||
2. No mentions of `JSON-serialized`. | ||
As underlying libraries handle serialization, these words are removed from the explantions. | ||
3. No mentions of integer numbers that exceed 2^31 but not 2^51. | ||
All numbers are 64-bit floats in JS, so this is irrelevant. | ||
Note that JS bit operators cast numbers to 32-bit integers and back, but we deliberately ignore this because people who use bit operators on identifiers or file sizes should know what they're doing, and they should also know that it's a bad idea. | ||
4. No `More info on Sending Files »`. | ||
File handling is abstracted away by the underlying library. | ||
Also, without the links, it's useless anyway. |
@@ -41,9 +41,9 @@ import { CallbackQuery } from "./markup"; | ||
export interface Update { | ||
/** The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. */ | ||
/** The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. */ | ||
update_id: number; | ||
/** New incoming message of any kind — text, photo, sticker, etc. */ | ||
/** New incoming message of any kind - text, photo, sticker, etc. */ | ||
message?: Message; | ||
/** New version of a message that is known to the bot and was edited */ | ||
edited_message?: Message; | ||
/** New incoming channel post of any kind — text, photo, sticker, etc. */ | ||
/** New incoming channel post of any kind - text, photo, sticker, etc. */ | ||
channel_post?: Message; | ||
@@ -50,0 +50,0 @@ /** New version of a channel post that is known to the bot and was edited */ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
243269
17
3961
92