Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@grammyjs/types

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@grammyjs/types - npm Package Compare versions

Comparing version 2.12.1 to 3.0.0

methods.d.ts

23

api.d.ts
export interface ApiError {
ok: false;
error_code: number;
description: string;
parameters?: ResponseParameters;
ok: false;
error_code: number;
description: string;
parameters?: ResponseParameters;
}
export interface ApiSuccess<T> {
ok: true;
result: T;
ok: true;
result: T;
}
/** The response contains an object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals true, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error.

@@ -18,9 +16,8 @@

export type ApiResponse<T> = ApiError | ApiSuccess<T>;
/** Describes why a request was unsuccessful. */
export interface ResponseParameters {
/** 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. */
migrate_to_chat_id?: number;
/** In case of exceeding flood control, the number of seconds left to wait before the request can be repeated */
retry_after?: number;
/** 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. */
migrate_to_chat_id?: number;
/** In case of exceeding flood control, the number of seconds left to wait before the request can be repeated */
retry_after?: number;
}

@@ -1,22 +0,20 @@

import { Chat, User } from "./manage";
import { InlineKeyboardMarkup } from "./markup";
import { Location, MessageEntity, ParseMode } from "./message";
import { LabeledPrice } from "./payment";
import type { Chat, User } from "./manage.js";
import type { InlineKeyboardMarkup } from "./markup.js";
import type { Location, MessageEntity, ParseMode } from "./message.js";
import type { LabeledPrice } from "./payment.js";
/** This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. */
export interface InlineQuery {
/** Unique identifier for this query */
id: string;
/** Sender */
from: User;
/** Text of the query (up to 256 characters) */
query: string;
/** Offset of the results to be returned, can be controlled by the bot */
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 */
chat_type?: "sender" | Chat["type"];
/** Sender location, only for bots that request user location */
location?: Location;
/** Unique identifier for this query */
id: string;
/** Sender */
from: User;
/** Text of the query (up to 256 characters) */
query: string;
/** Offset of the results to be returned, can be controlled by the bot */
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 */
chat_type?: "sender" | Chat["type"];
/** Sender location, only for bots that request user location */
location?: Location;
}
/** This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:

@@ -45,140 +43,115 @@ - InlineQueryResultCachedAudio

Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public. */
export type InlineQueryResult =
| InlineQueryResultCachedAudio
| InlineQueryResultCachedDocument
| InlineQueryResultCachedGif
| InlineQueryResultCachedMpeg4Gif
| InlineQueryResultCachedPhoto
| InlineQueryResultCachedSticker
| InlineQueryResultCachedVideo
| InlineQueryResultCachedVoice
| InlineQueryResultArticle
| InlineQueryResultAudio
| InlineQueryResultContact
| InlineQueryResultGame
| InlineQueryResultDocument
| InlineQueryResultGif
| InlineQueryResultLocation
| InlineQueryResultMpeg4Gif
| InlineQueryResultPhoto
| InlineQueryResultVenue
| InlineQueryResultVideo
| InlineQueryResultVoice;
export type InlineQueryResult = InlineQueryResultCachedAudio | InlineQueryResultCachedDocument | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedPhoto | InlineQueryResultCachedSticker | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultArticle | InlineQueryResultAudio | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultDocument | InlineQueryResultGif | InlineQueryResultLocation | InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVenue | InlineQueryResultVideo | InlineQueryResultVoice;
/** Represents a link to an article or web page. */
export interface InlineQueryResultArticle {
/** Type of the result, must be article */
type: "article";
/** Unique identifier for this result, 1-64 Bytes */
id: string;
/** Title of the result */
title: string;
/** Content of the message to be sent */
input_message_content: InputMessageContent;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** URL of the result */
url?: string;
/** Pass True if you don't want the URL to be shown in the message */
hide_url?: boolean;
/** Short description of the result */
description?: string;
/** Url of the thumbnail for the result */
thumb_url?: string;
/** Thumbnail width */
thumb_width?: number;
/** Thumbnail height */
thumb_height?: number;
/** Type of the result, must be article */
type: "article";
/** Unique identifier for this result, 1-64 Bytes */
id: string;
/** Title of the result */
title: string;
/** Content of the message to be sent */
input_message_content: InputMessageContent;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** URL of the result */
url?: string;
/** Pass True if you don't want the URL to be shown in the message */
hide_url?: boolean;
/** Short description of the result */
description?: string;
/** Url of the thumbnail for the result */
thumbnail_url?: string;
/** Thumbnail width */
thumbnail_width?: number;
/** Thumbnail height */
thumbnail_height?: number;
}
/** Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo. */
export interface InlineQueryResultPhoto {
/** Type of the result, must be photo */
type: "photo";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB */
photo_url: string;
/** URL of the thumbnail for the photo */
thumb_url: string;
/** Width of the photo */
photo_width?: number;
/** Height of the photo */
photo_height?: number;
/** Title for the result */
title?: string;
/** Short description of the result */
description?: string;
/** Caption of the photo to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the photo caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the photo */
input_message_content?: InputMessageContent;
/** Type of the result, must be photo */
type: "photo";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB */
photo_url: string;
/** URL of the thumbnail for the photo */
thumbnail_url: string;
/** Width of the photo */
photo_width?: number;
/** Height of the photo */
photo_height?: number;
/** Title for the result */
title?: string;
/** Short description of the result */
description?: string;
/** Caption of the photo to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the photo caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the photo */
input_message_content?: InputMessageContent;
}
/** Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. */
export interface InlineQueryResultGif {
/** Type of the result, must be gif */
type: "gif";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL for the GIF file. File size must not exceed 1MB */
gif_url: string;
/** Width of the GIF */
gif_width?: number;
/** Height of the GIF */
gif_height?: number;
/** Duration of the GIF in seconds */
gif_duration?: number;
/** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
thumb_url: string;
/** 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";
/** Title for the result */
title?: string;
/** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the GIF animation */
input_message_content?: InputMessageContent;
/** Type of the result, must be gif */
type: "gif";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL for the GIF file. File size must not exceed 1MB */
gif_url: string;
/** Width of the GIF */
gif_width?: number;
/** Height of the GIF */
gif_height?: number;
/** Duration of the GIF in seconds */
gif_duration?: number;
/** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
thumbnail_url: string;
/** MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” */
thumbnail_mime_type?: "image/jpeg" | "image/gif" | "video/mp4";
/** Title for the result */
title?: string;
/** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the GIF animation */
input_message_content?: InputMessageContent;
}
/** Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. */
export interface InlineQueryResultMpeg4Gif {
/** Type of the result, must be mpeg4_gif */
type: "mpeg4_gif";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL for the MPEG4 file. File size must not exceed 1MB */
mpeg4_url: string;
/** Video width */
mpeg4_width?: number;
/** Video height */
mpeg4_height?: number;
/** Video duration in seconds */
mpeg4_duration?: number;
/** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
thumb_url: string;
/** 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";
/** Title for the result */
title?: string;
/** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the video animation */
input_message_content?: InputMessageContent;
/** Type of the result, must be mpeg4_gif */
type: "mpeg4_gif";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL for the MPEG4 file. File size must not exceed 1MB */
mpeg4_url: string;
/** Video width */
mpeg4_width?: number;
/** Video height */
mpeg4_height?: number;
/** Video duration in seconds */
mpeg4_duration?: number;
/** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
thumbnail_url: string;
/** MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” */
thumbnail_mime_type?: "image/jpeg" | "image/gif" | "video/mp4";
/** Title for the result */
title?: string;
/** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the video animation */
input_message_content?: InputMessageContent;
}
/** Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

@@ -188,34 +161,33 @@

export interface InlineQueryResultVideo {
/** Type of the result, must be video */
type: "video";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL for the embedded video player or video file */
video_url: string;
/** MIME type of the content of the video URL, “text/html” or “video/mp4” */
mime_type: "text/html" | "video/mp4";
/** URL of the thumbnail (JPEG only) for the video */
thumb_url: string;
/** Title for the result */
title: string;
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the video caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Video width */
video_width?: number;
/** Video height */
video_height?: number;
/** Video duration in seconds */
video_duration?: number;
/** Short description of the result */
description?: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video). */
input_message_content?: InputMessageContent;
/** Type of the result, must be video */
type: "video";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL for the embedded video player or video file */
video_url: string;
/** MIME type of the content of the video URL, “text/html” or “video/mp4” */
mime_type: "text/html" | "video/mp4";
/** URL of the thumbnail (JPEG only) for the video */
thumbnail_url: string;
/** Title for the result */
title: string;
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the video caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Video width */
video_width?: number;
/** Video height */
video_height?: number;
/** Video duration in seconds */
video_duration?: number;
/** Short description of the result */
description?: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video). */
input_message_content?: InputMessageContent;
}
/** Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

@@ -225,26 +197,25 @@

export interface InlineQueryResultAudio {
/** Type of the result, must be audio */
type: "audio";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL for the audio file */
audio_url: string;
/** Title */
title: string;
/** Caption, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the audio caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Performer */
performer?: string;
/** Audio duration in seconds */
audio_duration?: number;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the audio */
input_message_content?: InputMessageContent;
/** Type of the result, must be audio */
type: "audio";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL for the audio file */
audio_url: string;
/** Title */
title: string;
/** Caption, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the audio caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Performer */
performer?: string;
/** Audio duration in seconds */
audio_duration?: number;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the audio */
input_message_content?: InputMessageContent;
}
/** Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.

@@ -254,22 +225,21 @@

export interface InlineQueryResultVoice {
/** Type of the result, must be voice */
type: "voice";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL for the voice recording */
voice_url: string;
/** Recording title */
title: string;
/** Caption, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the voice message caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Recording duration in seconds */
voice_duration?: number;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the voice recording */
input_message_content?: InputMessageContent;
/** Type of the result, must be voice */
type: "voice";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid URL for the voice recording */
voice_url: string;
/** Recording title */
title: string;
/** Caption, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the voice message caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Recording duration in seconds */
voice_duration?: number;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the voice recording */
input_message_content?: InputMessageContent;
}
/** Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.

@@ -279,32 +249,31 @@

export interface InlineQueryResultDocument {
/** Type of the result, must be document */
type: "document";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** Title for the result */
title: string;
/** Caption of the document to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the document caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** A valid URL for the file */
document_url: string;
/** MIME type of the content of the file, either “application/pdf” or “application/zip” */
mime_type: "application/pdf" | "application/zip";
/** Short description of the result */
description?: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the file */
input_message_content?: InputMessageContent;
/** URL of the thumbnail (JPEG only) for the file */
thumb_url?: string;
/** Thumbnail width */
thumb_width?: number;
/** Thumbnail height */
thumb_height?: number;
/** Type of the result, must be document */
type: "document";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** Title for the result */
title: string;
/** Caption of the document to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the document caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** A valid URL for the file */
document_url: string;
/** MIME type of the content of the file, either “application/pdf” or “application/zip” */
mime_type: "application/pdf" | "application/zip";
/** Short description of the result */
description?: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the file */
input_message_content?: InputMessageContent;
/** URL of the thumbnail (JPEG only) for the file */
thumbnail_url?: string;
/** Thumbnail width */
thumbnail_width?: number;
/** Thumbnail height */
thumbnail_height?: number;
}
/** Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.

@@ -314,32 +283,31 @@

export interface InlineQueryResultLocation {
/** Type of the result, must be location */
type: "location";
/** Unique identifier for this result, 1-64 Bytes */
id: string;
/** Location latitude in degrees */
latitude: number;
/** Location longitude in degrees */
longitude: number;
/** Location title */
title: string;
/** The radius of uncertainty for the location, measured in meters; 0-1500 */
horizontal_accuracy?: number;
/** Period in seconds for which the location can be updated, should be between 60 and 86400. */
live_period?: number;
/** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
heading?: number;
/** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */
proximity_alert_radius?: number;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the location */
input_message_content?: InputMessageContent;
/** Url of the thumbnail for the result */
thumb_url?: string;
/** Thumbnail width */
thumb_width?: number;
/** Thumbnail height */
thumb_height?: number;
/** Type of the result, must be location */
type: "location";
/** Unique identifier for this result, 1-64 Bytes */
id: string;
/** Location latitude in degrees */
latitude: number;
/** Location longitude in degrees */
longitude: number;
/** Location title */
title: string;
/** The radius of uncertainty for the location, measured in meters; 0-1500 */
horizontal_accuracy?: number;
/** Period in seconds for which the location can be updated, should be between 60 and 86400. */
live_period?: number;
/** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
heading?: number;
/** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */
proximity_alert_radius?: number;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the location */
input_message_content?: InputMessageContent;
/** Url of the thumbnail for the result */
thumbnail_url?: string;
/** Thumbnail width */
thumbnail_width?: number;
/** Thumbnail height */
thumbnail_height?: number;
}
/** Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.

@@ -349,34 +317,33 @@

export interface InlineQueryResultVenue {
/** Type of the result, must be venue */
type: "venue";
/** Unique identifier for this result, 1-64 Bytes */
id: string;
/** Latitude of the venue location in degrees */
latitude: number;
/** Longitude of the venue location in degrees */
longitude: number;
/** Title of the venue */
title: string;
/** Address of the venue */
address: string;
/** Foursquare identifier of the venue if known */
foursquare_id?: string;
/** Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */
foursquare_type?: string;
/** Google Places identifier of the venue */
google_place_id?: string;
/** Google Places type of the venue. (See supported types.) */
google_place_type?: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the venue */
input_message_content?: InputMessageContent;
/** Url of the thumbnail for the result */
thumb_url?: string;
/** Thumbnail width */
thumb_width?: number;
/** Thumbnail height */
thumb_height?: number;
/** Type of the result, must be venue */
type: "venue";
/** Unique identifier for this result, 1-64 Bytes */
id: string;
/** Latitude of the venue location in degrees */
latitude: number;
/** Longitude of the venue location in degrees */
longitude: number;
/** Title of the venue */
title: string;
/** Address of the venue */
address: string;
/** Foursquare identifier of the venue if known */
foursquare_id?: string;
/** Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */
foursquare_type?: string;
/** Google Places identifier of the venue */
google_place_id?: string;
/** Google Places type of the venue. (See supported types.) */
google_place_type?: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the venue */
input_message_content?: InputMessageContent;
/** Url of the thumbnail for the result */
thumbnail_url?: string;
/** Thumbnail width */
thumbnail_width?: number;
/** Thumbnail height */
thumbnail_height?: number;
}
/** Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.

@@ -386,26 +353,25 @@

export interface InlineQueryResultContact {
/** Type of the result, must be contact */
type: "contact";
/** Unique identifier for this result, 1-64 Bytes */
id: string;
/** Contact's phone number */
phone_number: string;
/** Contact's first name */
first_name: string;
/** Contact's last name */
last_name?: string;
/** Additional data about the contact in the form of a vCard, 0-2048 bytes */
vcard?: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the contact */
input_message_content?: InputMessageContent;
/** Url of the thumbnail for the result */
thumb_url?: string;
/** Thumbnail width */
thumb_width?: number;
/** Thumbnail height */
thumb_height?: number;
/** Type of the result, must be contact */
type: "contact";
/** Unique identifier for this result, 1-64 Bytes */
id: string;
/** Contact's phone number */
phone_number: string;
/** Contact's first name */
first_name: string;
/** Contact's last name */
last_name?: string;
/** Additional data about the contact in the form of a vCard, 0-2048 bytes */
vcard?: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the contact */
input_message_content?: InputMessageContent;
/** Url of the thumbnail for the result */
thumbnail_url?: string;
/** Thumbnail width */
thumbnail_width?: number;
/** Thumbnail height */
thumbnail_height?: number;
}
/** Represents a Game.

@@ -415,76 +381,72 @@

export interface InlineQueryResultGame {
/** Type of the result, must be game */
type: "game";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** Short name of the game */
game_short_name: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Type of the result, must be game */
type: "game";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** Short name of the game */
game_short_name: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
}
/** Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo. */
export interface InlineQueryResultCachedPhoto {
/** Type of the result, must be photo */
type: "photo";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier of the photo */
photo_file_id: string;
/** Title for the result */
title?: string;
/** Short description of the result */
description?: string;
/** Caption of the photo to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the photo caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the photo */
input_message_content?: InputMessageContent;
/** Type of the result, must be photo */
type: "photo";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier of the photo */
photo_file_id: string;
/** Title for the result */
title?: string;
/** Short description of the result */
description?: string;
/** Caption of the photo to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the photo caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the photo */
input_message_content?: InputMessageContent;
}
/** Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation. */
export interface InlineQueryResultCachedGif {
/** Type of the result, must be gif */
type: "gif";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier for the GIF file */
gif_file_id: string;
/** Title for the result */
title?: string;
/** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the GIF animation */
input_message_content?: InputMessageContent;
/** Type of the result, must be gif */
type: "gif";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier for the GIF file */
gif_file_id: string;
/** Title for the result */
title?: string;
/** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the GIF animation */
input_message_content?: InputMessageContent;
}
/** Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. */
export interface InlineQueryResultCachedMpeg4Gif {
/** Type of the result, must be mpeg4_gif */
type: "mpeg4_gif";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier for the MPEG4 file */
mpeg4_file_id: string;
/** Title for the result */
title?: string;
/** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the video animation */
input_message_content?: InputMessageContent;
/** Type of the result, must be mpeg4_gif */
type: "mpeg4_gif";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier for the MPEG4 file */
mpeg4_file_id: string;
/** Title for the result */
title?: string;
/** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the video animation */
input_message_content?: InputMessageContent;
}
/** Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.

@@ -495,14 +457,13 @@

export interface InlineQueryResultCachedSticker {
/** Type of the result, must be sticker */
type: "sticker";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier of the sticker */
sticker_file_id: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the sticker */
input_message_content?: InputMessageContent;
/** Type of the result, must be sticker */
type: "sticker";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier of the sticker */
sticker_file_id: string;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the sticker */
input_message_content?: InputMessageContent;
}
/** Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.

@@ -512,48 +473,46 @@

export interface InlineQueryResultCachedDocument {
/** Type of the result, must be document */
type: "document";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** Title for the result */
title: string;
/** A valid file identifier for the file */
document_file_id: string;
/** Short description of the result */
description?: string;
/** Caption of the document to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the document caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the file */
input_message_content?: InputMessageContent;
/** Type of the result, must be document */
type: "document";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** Title for the result */
title: string;
/** A valid file identifier for the file */
document_file_id: string;
/** Short description of the result */
description?: string;
/** Caption of the document to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the document caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the file */
input_message_content?: InputMessageContent;
}
/** Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video. */
export interface InlineQueryResultCachedVideo {
/** Type of the result, must be video */
type: "video";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier for the video file */
video_file_id: string;
/** Title for the result */
title: string;
/** Short description of the result */
description?: string;
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the video caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the video */
input_message_content?: InputMessageContent;
/** Type of the result, must be video */
type: "video";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier for the video file */
video_file_id: string;
/** Title for the result */
title: string;
/** Short description of the result */
description?: string;
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the video caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the video */
input_message_content?: InputMessageContent;
}
/** Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.

@@ -563,20 +522,19 @@

export interface InlineQueryResultCachedVoice {
/** Type of the result, must be voice */
type: "voice";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier for the voice message */
voice_file_id: string;
/** Voice message title */
title: string;
/** Caption, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the voice message caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the voice message */
input_message_content?: InputMessageContent;
/** Type of the result, must be voice */
type: "voice";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier for the voice message */
voice_file_id: string;
/** Voice message title */
title: string;
/** Caption, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the voice message caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the voice message */
input_message_content?: InputMessageContent;
}
/** Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

@@ -586,20 +544,19 @@

export interface InlineQueryResultCachedAudio {
/** Type of the result, must be audio */
type: "audio";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier for the audio file */
audio_file_id: string;
/** Caption, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the audio caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the audio */
input_message_content?: InputMessageContent;
/** Type of the result, must be audio */
type: "audio";
/** Unique identifier for this result, 1-64 bytes */
id: string;
/** A valid file identifier for the audio file */
audio_file_id: string;
/** Caption, 0-1024 characters after entities parsing */
caption?: string;
/** Mode for parsing entities in the audio caption. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in the caption, which can be specified instead of parse_mode */
caption_entities?: MessageEntity[];
/** Inline keyboard attached to the message */
reply_markup?: InlineKeyboardMarkup;
/** Content of the message to be sent instead of the audio */
input_message_content?: InputMessageContent;
}
/** This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types:

@@ -612,113 +569,102 @@

- InputInvoiceMessageContent */
export type InputMessageContent =
| InputTextMessageContent
| InputLocationMessageContent
| InputVenueMessageContent
| InputContactMessageContent
| InputInvoiceMessageContent;
export type InputMessageContent = InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent;
/** Represents the content of a text message to be sent as the result of an inline query. */
export interface InputTextMessageContent {
/** Text of the message to be sent, 1-4096 characters */
message_text: string;
/** Mode for parsing entities in the message text. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in message text, which can be specified instead of parse_mode */
entities?: MessageEntity[];
/** Disables link previews for links in the sent message */
disable_web_page_preview?: boolean;
/** Text of the message to be sent, 1-4096 characters */
message_text: string;
/** Mode for parsing entities in the message text. See formatting options for more details. */
parse_mode?: ParseMode;
/** List of special entities that appear in message text, which can be specified instead of parse_mode */
entities?: MessageEntity[];
/** Disables link previews for links in the sent message */
disable_web_page_preview?: boolean;
}
/** Represents the content of a location message to be sent as the result of an inline query. */
export interface InputLocationMessageContent {
/** Latitude of the location in degrees */
latitude: number;
/** Longitude of the location in degrees */
longitude: number;
/** The radius of uncertainty for the location, measured in meters; 0-1500 */
horizontal_accuracy?: number;
/** Period in seconds for which the location can be updated, should be between 60 and 86400. */
live_period?: number;
/** For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */
heading?: number;
/** For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. */
proximity_alert_radius?: number;
/** Latitude of the location in degrees */
latitude: number;
/** Longitude of the location in degrees */
longitude: number;
/** The radius of uncertainty for the location, measured in meters; 0-1500 */
horizontal_accuracy?: number;
/** Period in seconds for which the location can be updated, should be between 60 and 86400. */
live_period?: number;
/** For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */
heading?: number;
/** For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. */
proximity_alert_radius?: number;
}
/** Represents the content of a venue message to be sent as the result of an inline query. */
export interface InputVenueMessageContent {
/** Latitude of the venue in degrees */
latitude: number;
/** Longitude of the venue in degrees */
longitude: number;
/** Name of the venue */
title: string;
/** Address of the venue */
address: string;
/** Foursquare identifier of the venue, if known */
foursquare_id?: string;
/** Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */
foursquare_type?: string;
/** Google Places identifier of the venue */
google_place_id?: string;
/** Google Places type of the venue. (See supported types.) */
google_place_type?: string;
/** Latitude of the venue in degrees */
latitude: number;
/** Longitude of the venue in degrees */
longitude: number;
/** Name of the venue */
title: string;
/** Address of the venue */
address: string;
/** Foursquare identifier of the venue, if known */
foursquare_id?: string;
/** Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */
foursquare_type?: string;
/** Google Places identifier of the venue */
google_place_id?: string;
/** Google Places type of the venue. (See supported types.) */
google_place_type?: string;
}
/** Represents the content of a contact message to be sent as the result of an inline query. */
export interface InputContactMessageContent {
/** Contact's phone number */
phone_number: string;
/** Contact's first name */
first_name: string;
/** Contact's last name */
last_name?: string;
/** Additional data about the contact in the form of a vCard, 0-2048 bytes */
vcard?: string;
/** Contact's phone number */
phone_number: string;
/** Contact's first name */
first_name: string;
/** Contact's last name */
last_name?: string;
/** Additional data about the contact in the form of a vCard, 0-2048 bytes */
vcard?: string;
}
/** Represents the content of an invoice message to be sent as the result of an inline query. */
export interface InputInvoiceMessageContent {
/** Product name, 1-32 characters */
title: string;
/** Product description, 1-255 characters */
description: string;
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
payload: string;
/** Payment provider token, obtained via BotFather */
provider_token: string;
/** Three-letter ISO 4217 currency code, see more on currencies */
currency: string;
/** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
prices: LabeledPrice[];
/** The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 */
max_tip_amount?: number;
/** An array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. */
suggested_tip_amounts?: number[];
/** 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. */
photo_url?: string;
/** Photo size in bytes */
photo_size?: number;
/** Photo width */
photo_width?: number;
/** Photo height */
photo_height?: number;
/** Pass True if you require the user's full name to complete the order */
need_name?: boolean;
/** Pass True if you require the user's phone number to complete the order */
need_phone_number?: boolean;
/** Pass True if you require the user's email address to complete the order */
need_email?: boolean;
/** Pass True if you require the user's shipping address to complete the order */
need_shipping_address?: boolean;
/** Pass True if the user's phone number should be sent to provider */
send_phone_number_to_provider?: boolean;
/** Pass True if the user's email address should be sent to provider */
send_email_to_provider?: boolean;
/** Pass True if the final price depends on the shipping method */
is_flexible?: boolean;
/** Product name, 1-32 characters */
title: string;
/** Product description, 1-255 characters */
description: string;
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */
payload: string;
/** Payment provider token, obtained via BotFather */
provider_token: string;
/** Three-letter ISO 4217 currency code, see more on currencies */
currency: string;
/** Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) */
prices: LabeledPrice[];
/** The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 */
max_tip_amount?: number;
/** An array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. */
suggested_tip_amounts?: number[];
/** 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. */
photo_url?: string;
/** Photo size in bytes */
photo_size?: number;
/** Photo width */
photo_width?: number;
/** Photo height */
photo_height?: number;
/** Pass True if you require the user's full name to complete the order */
need_name?: boolean;
/** Pass True if you require the user's phone number to complete the order */
need_phone_number?: boolean;
/** Pass True if you require the user's email address to complete the order */
need_email?: boolean;
/** Pass True if you require the user's shipping address to complete the order */
need_shipping_address?: boolean;
/** Pass True if the user's phone number should be sent to provider */
send_phone_number_to_provider?: boolean;
/** Pass True if the user's email address should be sent to provider */
send_email_to_provider?: boolean;
/** Pass True if the final price depends on the shipping method */
is_flexible?: boolean;
}
/** Represents a result of an inline query that was chosen by the user and sent to their chat partner.

@@ -728,12 +674,12 @@

export interface ChosenInlineResult {
/** The unique identifier for the result that was chosen */
result_id: string;
/** The user that chose the result */
from: User;
/** Sender location, only for bots that require user location */
location?: Location;
/** Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. */
inline_message_id?: string;
/** The query that was used to obtain the result */
query: string;
/** The unique identifier for the result that was chosen */
result_id: string;
/** The user that chose the result */
from: User;
/** Sender location, only for bots that require user location */
location?: Location;
/** Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. */
inline_message_id?: string;
/** The query that was used to obtain the result */
query: string;
}

@@ -1,262 +0,233 @@

import { Location, Message, PhotoSize } from "./message";
import { Update } from "./update";
import type { Location, Message, PhotoSize } from "./message.js";
import type { Update } from "./update.js";
/** Describes the current status of a webhook. */
export interface WebhookInfo {
/** Webhook URL, may be empty if webhook is not set up */
url?: string;
/** True, if a custom certificate was provided for webhook certificate checks */
has_custom_certificate: boolean;
/** Number of updates awaiting delivery */
pending_update_count: number;
/** Currently used webhook IP address */
ip_address?: string;
/** Unix time for the most recent error that happened when trying to deliver an update via webhook */
last_error_date: number;
/** Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook */
last_error_message: string;
/** Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters */
last_synchronization_error_date?: number;
/** The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */
max_connections: number;
/** A list of update types the bot is subscribed to. Defaults to all update types except chat_member */
allowed_updates: Array<Exclude<keyof Update, "update_id">>;
/** Webhook URL, may be empty if webhook is not set up */
url?: string;
/** True, if a custom certificate was provided for webhook certificate checks */
has_custom_certificate: boolean;
/** Number of updates awaiting delivery */
pending_update_count: number;
/** Currently used webhook IP address */
ip_address?: string;
/** Unix time for the most recent error that happened when trying to deliver an update via webhook */
last_error_date: number;
/** Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook */
last_error_message: string;
/** Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters */
last_synchronization_error_date?: number;
/** The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */
max_connections: number;
/** A list of update types the bot is subscribed to. Defaults to all update types except chat_member */
allowed_updates: Array<Exclude<keyof Update, "update_id">>;
}
/** This object represents a Telegram user or bot. */
export interface User {
/** Unique identifier for this user or bot. 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 64-bit integer or double-precision float type are safe for storing this identifier. */
id: number;
/** True, if this user is a bot */
is_bot: boolean;
/** User's or bot's first name */
first_name: string;
/** User's or bot's last name */
last_name?: string;
/** User's or bot's username */
username?: string;
/** IETF language tag of the user's language */
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;
/** Unique identifier for this user or bot. 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 64-bit integer or double-precision float type are safe for storing this identifier. */
id: number;
/** True, if this user is a bot */
is_bot: boolean;
/** User's or bot's first name */
first_name: string;
/** User's or bot's last name */
last_name?: string;
/** User's or bot's username */
username?: string;
/** IETF language tag of the user's language */
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;
}
/** This object represents a Telegram user or bot that was returned by `getMe`. */
export interface UserFromGetMe extends User {
is_bot: true;
username: string;
/** True, if the bot can be invited to groups. Returned only in getMe. */
can_join_groups: boolean;
/** True, if privacy mode is disabled for the bot. Returned only in getMe. */
can_read_all_group_messages: boolean;
/** True, if the bot supports inline queries. Returned only in getMe. */
supports_inline_queries: boolean;
is_bot: true;
username: string;
/** True, if the bot can be invited to groups. Returned only in getMe. */
can_join_groups: boolean;
/** True, if privacy mode is disabled for the bot. Returned only in getMe. */
can_read_all_group_messages: boolean;
/** True, if the bot supports inline queries. Returned only in getMe. */
supports_inline_queries: boolean;
}
export namespace Chat {
// ABSTRACT
/** Internal type holding properties that all kinds of chats share. */
interface AbstractChat {
/** 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. */
id: number;
/** Type of chat, can be either “private”, “group”, “supergroup” or “channel” */
type: string;
}
// HELPERS
/** Internal type holding properties that those chats with user names share. */
interface UserNameChat {
/** Username, for private chats, supergroups and channels if available */
username?: string;
}
/** Internal type holding properties that those chats with titles share. */
interface TitleChat {
/** Title, for supergroups, channels and group chats */
title: string;
}
// ==> CHATS
/** Internal type representing private chats. */
export interface PrivateChat extends AbstractChat, UserNameChat {
type: "private";
/** First name of the other party in a private chat */
first_name: string;
/** Last name of the other party in a private chat */
last_name?: string;
}
/** Internal type representing group chats. */
export interface GroupChat extends AbstractChat, TitleChat {
type: "group";
}
/** Internal type representing super group chats. */
export interface SupergroupChat
extends AbstractChat, UserNameChat, TitleChat {
type: "supergroup";
/** True, if the supergroup chat is a forum (has topics enabled) */
is_forum?: true;
}
/** Internal type representing channel chats. */
export interface ChannelChat extends AbstractChat, UserNameChat, TitleChat {
type: "channel";
}
// GET CHAT HELPERS
/** Internal type holding properties that those chats returned from `getChat` share. */
interface GetChat {
/** Chat photo. Returned only in getChat. */
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. */
pinned_message?: Message;
/** The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. */
message_auto_delete_time?: number;
/** True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. */
has_protected_content?: true;
}
/** Internal type holding properties that those private, supergroup, and channel chats returned from `getChat` share. */
interface NonGroupGetChat extends GetChat {
/** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat. */
active_usernames?: string[];
}
/** Internal type holding properties that those group, supergroup, and channel chats returned from `getChat` share. */
interface NonPrivateGetChat extends GetChat {
/** Description, for groups, supergroups and channel chats. Returned only in getChat. */
description?: string;
/** Primary invite link, for groups, supergroups and channel chats. Returned only in getChat. */
invite_link?: string;
}
/** Internal type holding properties that those group and supergroup chats returned from `getChat` share. */
interface MultiUserGetChat extends NonPrivateGetChat {
/** Default chat member permissions, for groups and supergroups. Returned only in getChat. */
permissions?: ChatPermissions;
/** True, if the bot can change the group sticker set. Returned only in getChat. */
can_set_sticker_set?: true;
}
/** Internal type holding properties that those supergroup and channel chats returned from `getChat` share. */
interface LargeGetChat extends NonPrivateGetChat {
/** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat. */
linked_chat_id?: number;
}
// ==> GET CHATS
/** Internal type representing private chats returned from `getChat`. */
export interface PrivateGetChat
extends PrivateChat, NonGroupGetChat, GetChat {
/** Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. */
emoji_status_custom_emoji_id?: string;
/** Bio of the other party in a private chat. Returned only in getChat. */
bio?: string;
/** True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat. */
has_private_forwards?: true;
/** True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat. */
has_restricted_voice_and_video_messages?: true;
}
/** Internal type representing group chats returned from `getChat`. */
export interface GroupGetChat extends GroupChat, MultiUserGetChat {}
/** Internal type representing supergroup chats returned from `getChat`. */
export interface SupergroupGetChat
extends SupergroupChat, NonGroupGetChat, MultiUserGetChat, LargeGetChat {
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. */
slow_mode_delay?: number;
/** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat. */
has_aggressive_anti_spam_enabled?: true;
/** For supergroups, name of group sticker set. Returned only in getChat. */
sticker_set_name?: string;
/** For supergroups, the location to which the supergroup is connected. Returned only in getChat. */
location?: ChatLocation;
}
/** Internal type representing channel chats returned from `getChat`. */
export interface ChannelGetChat
extends ChannelChat, NonGroupGetChat, LargeGetChat {}
export declare namespace Chat {
/** Internal type holding properties that all kinds of chats share. */
interface AbstractChat {
/** 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. */
id: number;
/** Type of chat, can be either “private”, “group”, “supergroup” or “channel” */
type: string;
}
/** Internal type holding properties that those chats with user names share. */
interface UserNameChat {
/** Username, for private chats, supergroups and channels if available */
username?: string;
}
/** Internal type holding properties that those chats with titles share. */
interface TitleChat {
/** Title, for supergroups, channels and group chats */
title: string;
}
/** Internal type representing private chats. */
export interface PrivateChat extends AbstractChat, UserNameChat {
type: "private";
/** First name of the other party in a private chat */
first_name: string;
/** Last name of the other party in a private chat */
last_name?: string;
}
/** Internal type representing group chats. */
export interface GroupChat extends AbstractChat, TitleChat {
type: "group";
}
/** Internal type representing super group chats. */
export interface SupergroupChat extends AbstractChat, UserNameChat, TitleChat {
type: "supergroup";
/** True, if the supergroup chat is a forum (has topics enabled) */
is_forum?: true;
}
/** Internal type representing channel chats. */
export interface ChannelChat extends AbstractChat, UserNameChat, TitleChat {
type: "channel";
}
/** Internal type holding properties that those chats returned from `getChat` share. */
interface GetChat {
/** Chat photo. Returned only in getChat. */
photo?: ChatPhoto;
/** The most recent pinned message (by sending date). Returned only in getChat. */
pinned_message?: Message;
/** The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. */
message_auto_delete_time?: number;
/** True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. */
has_protected_content?: true;
}
/** Internal type holding properties that those private, supergroup, and channel chats returned from `getChat` share. */
interface NonGroupGetChat extends GetChat {
/** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat. */
active_usernames?: string[];
}
/** Internal type holding properties that those group, supergroup, and channel chats returned from `getChat` share. */
interface NonPrivateGetChat extends GetChat {
/** Description, for groups, supergroups and channel chats. Returned only in getChat. */
description?: string;
/** Primary invite link, for groups, supergroups and channel chats. Returned only in getChat. */
invite_link?: string;
}
/** Internal type holding properties that those group and supergroup chats returned from `getChat` share. */
interface MultiUserGetChat extends NonPrivateGetChat {
/** Default chat member permissions, for groups and supergroups. Returned only in getChat. */
permissions?: ChatPermissions;
/** True, if the bot can change the group sticker set. Returned only in getChat. */
can_set_sticker_set?: true;
}
/** Internal type holding properties that those supergroup and channel chats returned from `getChat` share. */
interface LargeGetChat extends NonPrivateGetChat {
/** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat. */
linked_chat_id?: number;
}
/** Internal type representing private chats returned from `getChat`. */
export interface PrivateGetChat extends PrivateChat, NonGroupGetChat, GetChat {
/** Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. */
emoji_status_custom_emoji_id?: string;
/** Bio of the other party in a private chat. Returned only in getChat. */
bio?: string;
/** True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat. */
has_private_forwards?: true;
/** True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat. */
has_restricted_voice_and_video_messages?: true;
}
/** Internal type representing group chats returned from `getChat`. */
export interface GroupGetChat extends GroupChat, MultiUserGetChat {
}
/** Internal type representing supergroup chats returned from `getChat`. */
export interface SupergroupGetChat extends SupergroupChat, NonGroupGetChat, MultiUserGetChat, LargeGetChat {
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. */
slow_mode_delay?: number;
/** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat. */
has_aggressive_anti_spam_enabled?: true;
/** For supergroups, name of group sticker set. Returned only in getChat. */
sticker_set_name?: string;
/** For supergroups, the location to which the supergroup is connected. Returned only in getChat. */
location?: ChatLocation;
/** 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;
}
/** Internal type representing channel chats returned from `getChat`. */
export interface ChannelGetChat extends ChannelChat, NonGroupGetChat, LargeGetChat {
}
export {};
}
/** This object represents a chat. */
export type Chat =
| Chat.PrivateChat
| Chat.GroupChat
| Chat.SupergroupChat
| Chat.ChannelChat;
export type Chat = Chat.PrivateChat | Chat.GroupChat | Chat.SupergroupChat | Chat.ChannelChat;
/** This object represents a Telegram user or bot that was returned by `getChat`. */
export type ChatFromGetChat =
| Chat.PrivateGetChat
| Chat.GroupGetChat
| Chat.SupergroupGetChat
| Chat.ChannelGetChat;
export type ChatFromGetChat = Chat.PrivateGetChat | Chat.GroupGetChat | Chat.SupergroupGetChat | Chat.ChannelGetChat;
/** This object represent a user's profile pictures. */
export interface UserProfilePhotos {
/** Total number of profile pictures the target user has */
total_count: number;
/** Requested profile pictures (in up to 4 sizes each) */
photos: PhotoSize[][];
/** Total number of profile pictures the target user has */
total_count: number;
/** Requested profile pictures (in up to 4 sizes each) */
photos: PhotoSize[][];
}
/** This object represents a chat photo. */
export interface ChatPhoto {
/** File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
small_file_id: string;
/** Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
small_file_unique_id: string;
/** File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
big_file_id: string;
/** Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
big_file_unique_id: string;
/** File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
small_file_id: string;
/** Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
small_file_unique_id: string;
/** File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
big_file_id: string;
/** Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
big_file_unique_id: string;
}
/** Represents an invite link for a chat. */
export interface ChatInviteLink {
/** The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with "...". */
invite_link: string;
/** Creator of the link */
creator: User;
/** True, if users joining the chat via the link need to be approved by chat administrators */
creates_join_request: boolean;
/** True, if the link is primary */
is_primary: boolean;
/** True, if the link is revoked */
is_revoked: boolean;
/** Invite link name */
name?: string;
/** Point in time (Unix timestamp) when the link will expire or has been expired */
expire_date?: number;
/** 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;
/** Number of pending join requests created using this link */
pending_join_request_count?: number;
/** The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with "...". */
invite_link: string;
/** Creator of the link */
creator: User;
/** True, if users joining the chat via the link need to be approved by chat administrators */
creates_join_request: boolean;
/** True, if the link is primary */
is_primary: boolean;
/** True, if the link is revoked */
is_revoked: boolean;
/** Invite link name */
name?: string;
/** Point in time (Unix timestamp) when the link will expire or has been expired */
expire_date?: number;
/** 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;
/** Number of pending join requests created using this link */
pending_join_request_count?: number;
}
/** Represents the rights of an administrator in a chat. */
export interface ChatAdministratorRights {
/** True, if the user's presence in the chat is hidden */
is_anonymous: boolean;
/** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */
can_manage_chat: boolean;
/** True, if the administrator can delete messages of other users */
can_delete_messages: boolean;
/** True, if the administrator can manage video chats */
can_manage_video_chats: boolean;
/** True, if the administrator can restrict, ban or unban chat members */
can_restrict_members: boolean;
/** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
can_promote_members: boolean;
/** True, if the user is allowed to change the chat title, photo and other settings */
can_change_info: boolean;
/** True, if the user is allowed to invite new users to the chat */
can_invite_users: boolean;
/** True, if the administrator can post in the channel; channels only */
can_post_messages?: boolean;
/** True, if the administrator can edit messages of other users and can pin messages; channels only */
can_edit_messages?: boolean;
/** True, if the user is allowed to pin messages; groups and supergroups only */
can_pin_messages?: boolean;
/** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
can_manage_topics?: boolean;
/** True, if the user's presence in the chat is hidden */
is_anonymous: boolean;
/** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */
can_manage_chat: boolean;
/** True, if the administrator can delete messages of other users */
can_delete_messages: boolean;
/** True, if the administrator can manage video chats */
can_manage_video_chats: boolean;
/** True, if the administrator can restrict, ban or unban chat members */
can_restrict_members: boolean;
/** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
can_promote_members: boolean;
/** True, if the user is allowed to change the chat title, photo and other settings */
can_change_info: boolean;
/** True, if the user is allowed to invite new users to the chat */
can_invite_users: boolean;
/** True, if the administrator can post in the channel; channels only */
can_post_messages?: boolean;
/** True, if the administrator can edit messages of other users and can pin messages; channels only */
can_edit_messages?: boolean;
/** True, if the user is allowed to pin messages; groups and supergroups only */
can_pin_messages?: boolean;
/** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
can_manage_topics?: boolean;
}
/** This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:

@@ -269,226 +240,207 @@ - ChatMemberOwner

- ChatMemberBanned */
export type ChatMember =
| ChatMemberOwner
| ChatMemberAdministrator
| ChatMemberMember
| ChatMemberRestricted
| ChatMemberLeft
| ChatMemberBanned;
export type ChatMember = ChatMemberOwner | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned;
/** Represents a chat member that owns the chat and has all administrator privileges. */
export interface ChatMemberOwner {
/** The member's status in the chat, always “creator” */
status: "creator";
/** Information about the user */
user: User;
/** True, if the user's presence in the chat is hidden */
is_anonymous: boolean;
/** Custom title for this user */
custom_title?: string;
/** The member's status in the chat, always “creator” */
status: "creator";
/** Information about the user */
user: User;
/** True, if the user's presence in the chat is hidden */
is_anonymous: boolean;
/** Custom title for this user */
custom_title?: string;
}
/** Represents a chat member that has some additional privileges. */
export interface ChatMemberAdministrator {
/** The member's status in the chat, always “administrator” */
status: "administrator";
/** Information about the user */
user: User;
/** True, if the bot is allowed to edit administrator privileges of that user */
can_be_edited: boolean;
/** True, if the user's presence in the chat is hidden */
is_anonymous: boolean;
/** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */
can_manage_chat: boolean;
/** True, if the administrator can delete messages of other users */
can_delete_messages: boolean;
/** True, if the administrator can manage video chats */
can_manage_video_chats: boolean;
/** True, if the administrator can restrict, ban or unban chat members */
can_restrict_members: boolean;
/** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
can_promote_members: boolean;
/** True, if the user is allowed to change the chat title, photo and other settings */
can_change_info: boolean;
/** True, if the user is allowed to invite new users to the chat */
can_invite_users: boolean;
/** True, if the administrator can post in the channel; channels only */
can_post_messages?: boolean;
/** True, if the administrator can edit messages of other users and can pin messages; channels only */
can_edit_messages?: boolean;
/** True, if the user is allowed to pin messages; groups and supergroups only */
can_pin_messages?: boolean;
/** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
can_manage_topics?: boolean;
/** Custom title for this user */
custom_title?: string;
/** The member's status in the chat, always “administrator” */
status: "administrator";
/** Information about the user */
user: User;
/** True, if the bot is allowed to edit administrator privileges of that user */
can_be_edited: boolean;
/** True, if the user's presence in the chat is hidden */
is_anonymous: boolean;
/** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */
can_manage_chat: boolean;
/** True, if the administrator can delete messages of other users */
can_delete_messages: boolean;
/** True, if the administrator can manage video chats */
can_manage_video_chats: boolean;
/** True, if the administrator can restrict, ban or unban chat members */
can_restrict_members: boolean;
/** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
can_promote_members: boolean;
/** True, if the user is allowed to change the chat title, photo and other settings */
can_change_info: boolean;
/** True, if the user is allowed to invite new users to the chat */
can_invite_users: boolean;
/** True, if the administrator can post in the channel; channels only */
can_post_messages?: boolean;
/** True, if the administrator can edit messages of other users and can pin messages; channels only */
can_edit_messages?: boolean;
/** True, if the user is allowed to pin messages; groups and supergroups only */
can_pin_messages?: boolean;
/** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
can_manage_topics?: boolean;
/** Custom title for this user */
custom_title?: string;
}
/** Represents a chat member that has no additional privileges or restrictions. */
export interface ChatMemberMember {
/** The member's status in the chat, always “member” */
status: "member";
/** Information about the user */
user: User;
/** The member's status in the chat, always “member” */
status: "member";
/** Information about the user */
user: User;
}
/** Represents a chat member that is under certain restrictions in the chat. Supergroups only. */
export interface ChatMemberRestricted {
/** The member's status in the chat, always “restricted” */
status: "restricted";
/** Information about the user */
user: User;
/** True, if the user is a member of the chat at the moment of the request */
is_member: boolean;
/** True, if the user is allowed to send text messages, contacts, invoices, locations and venues */
can_send_messages: boolean;
/** True, if the user is allowed to send audios */
can_send_audios: boolean;
/** True, if the user is allowed to send documents */
can_send_documents: boolean;
/** True, if the user is allowed to send photos */
can_send_photos: boolean;
/** True, if the user is allowed to send videos */
can_send_videos: boolean;
/** True, if the user is allowed to send video notes */
can_send_video_notes: boolean;
/** True, if the user is allowed to send voice notes */
can_send_voice_notes: boolean;
/** True, if the user is allowed to send polls */
can_send_polls: boolean;
/** True, if the user is allowed to send animations, games, stickers and use inline bots */
can_send_other_messages: boolean;
/** True, if the user is allowed to add web page previews to their messages */
can_add_web_page_previews: boolean;
/** True, if the user is allowed to change the chat title, photo and other settings */
can_change_info: boolean;
/** True, if the user is allowed to invite new users to the chat */
can_invite_users: boolean;
/** True, if the user is allowed to pin messages */
can_pin_messages: boolean;
/** True, if the user is allowed to create forum topics */
can_manage_topics: boolean;
/** Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever */
until_date: number;
/** The member's status in the chat, always “restricted” */
status: "restricted";
/** Information about the user */
user: User;
/** True, if the user is a member of the chat at the moment of the request */
is_member: boolean;
/** True, if the user is allowed to send text messages, contacts, invoices, locations and venues */
can_send_messages: boolean;
/** True, if the user is allowed to send audios */
can_send_audios: boolean;
/** True, if the user is allowed to send documents */
can_send_documents: boolean;
/** True, if the user is allowed to send photos */
can_send_photos: boolean;
/** True, if the user is allowed to send videos */
can_send_videos: boolean;
/** True, if the user is allowed to send video notes */
can_send_video_notes: boolean;
/** True, if the user is allowed to send voice notes */
can_send_voice_notes: boolean;
/** True, if the user is allowed to send polls */
can_send_polls: boolean;
/** True, if the user is allowed to send animations, games, stickers and use inline bots */
can_send_other_messages: boolean;
/** True, if the user is allowed to add web page previews to their messages */
can_add_web_page_previews: boolean;
/** True, if the user is allowed to change the chat title, photo and other settings */
can_change_info: boolean;
/** True, if the user is allowed to invite new users to the chat */
can_invite_users: boolean;
/** True, if the user is allowed to pin messages */
can_pin_messages: boolean;
/** True, if the user is allowed to create forum topics */
can_manage_topics: boolean;
/** Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever */
until_date: number;
}
/** Represents a chat member that isn't currently a member of the chat, but may join it themselves. */
export interface ChatMemberLeft {
/** The member's status in the chat, always “left” */
status: "left";
/** Information about the user */
user: User;
/** The member's status in the chat, always “left” */
status: "left";
/** Information about the user */
user: User;
}
/** Represents a chat member that was banned in the chat and can't return to the chat or view chat messages. */
export interface ChatMemberBanned {
/** The member's status in the chat, always “kicked” */
status: "kicked";
/** Information about the user */
user: User;
/** Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever */
until_date: number;
/** The member's status in the chat, always “kicked” */
status: "kicked";
/** Information about the user */
user: User;
/** Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever */
until_date: number;
}
/** This object represents changes in the status of a chat member. */
export interface ChatMemberUpdated {
/** Chat the user belongs to */
chat: Chat;
/** Performer of the action, which resulted in the change */
from: User;
/** Date the change was done in Unix time */
date: number;
/** Previous information about the chat member */
old_chat_member: ChatMember;
/** New information about the chat member */
new_chat_member: ChatMember;
/** Chat invite link, which was used by the user to join the chat; for joining by invite link events only. */
invite_link?: ChatInviteLink;
/** Chat the user belongs to */
chat: Chat;
/** Performer of the action, which resulted in the change */
from: User;
/** Date the change was done in Unix time */
date: number;
/** Previous information about the chat member */
old_chat_member: ChatMember;
/** New information about the chat member */
new_chat_member: ChatMember;
/** Chat invite link, which was used by the user to join the chat; for joining by invite link events only. */
invite_link?: ChatInviteLink;
}
/** Represents a join request sent to a chat. */
export interface ChatJoinRequest {
/** Chat to which the request was sent */
chat: Chat.SupergroupChat | Chat.ChannelChat;
/** User that sent the join request */
from: User;
/** Identifier of a private chat with the user who sent the join request. 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 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user. */
user_chat_id: number;
/** Date the request was sent in Unix time */
date: number;
/** Bio of the user. */
bio?: string;
/** Chat invite link that was used by the user to send the join request */
invite_link?: ChatInviteLink;
/** Chat to which the request was sent */
chat: Chat.SupergroupChat | Chat.ChannelChat;
/** User that sent the join request */
from: User;
/** Identifier of a private chat with the user who sent the join request. 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 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user. */
user_chat_id: number;
/** Date the request was sent in Unix time */
date: number;
/** Bio of the user. */
bio?: string;
/** Chat invite link that was used by the user to send the join request */
invite_link?: ChatInviteLink;
}
/** Describes actions that a non-administrator user is allowed to take in a chat. */
export interface ChatPermissions {
/** True, if the user is allowed to send text messages, contacts, invoices, locations and venues */
can_send_messages?: boolean;
/** True, if the user is allowed to send audios */
can_send_audios?: boolean;
/** True, if the user is allowed to send documents */
can_send_documents?: boolean;
/** True, if the user is allowed to send photos */
can_send_photos?: boolean;
/** True, if the user is allowed to send videos */
can_send_videos?: boolean;
/** True, if the user is allowed to send video notes */
can_send_video_notes?: boolean;
/** True, if the user is allowed to send voice notes */
can_send_voice_notes?: boolean;
/** True, if the user is allowed to send polls */
can_send_polls?: boolean;
/** True, if the user is allowed to send animations, games, stickers and use inline bots */
can_send_other_messages?: boolean;
/** True, if the user is allowed to add web page previews to their messages */
can_add_web_page_previews?: boolean;
/** True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */
can_change_info?: boolean;
/** True, if the user is allowed to invite new users to the chat */
can_invite_users?: boolean;
/** True, if the user is allowed to pin messages. Ignored in public supergroups */
can_pin_messages?: boolean;
/** True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages */
can_manage_topics?: boolean;
/** True, if the user is allowed to send text messages, contacts, invoices, locations and venues */
can_send_messages?: boolean;
/** True, if the user is allowed to send audios */
can_send_audios?: boolean;
/** True, if the user is allowed to send documents */
can_send_documents?: boolean;
/** True, if the user is allowed to send photos */
can_send_photos?: boolean;
/** True, if the user is allowed to send videos */
can_send_videos?: boolean;
/** True, if the user is allowed to send video notes */
can_send_video_notes?: boolean;
/** True, if the user is allowed to send voice notes */
can_send_voice_notes?: boolean;
/** True, if the user is allowed to send polls */
can_send_polls?: boolean;
/** True, if the user is allowed to send animations, games, stickers and use inline bots */
can_send_other_messages?: boolean;
/** True, if the user is allowed to add web page previews to their messages */
can_add_web_page_previews?: boolean;
/** True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */
can_change_info?: boolean;
/** True, if the user is allowed to invite new users to the chat */
can_invite_users?: boolean;
/** True, if the user is allowed to pin messages. Ignored in public supergroups */
can_pin_messages?: boolean;
/** True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages */
can_manage_topics?: boolean;
}
/** Represents a location to which a chat is connected. */
export interface ChatLocation {
/** The location to which the supergroup is connected. Can't be a live location. */
location: Location;
/** Location address; 1-64 characters, as defined by the chat owner */
address: string;
/** The location to which the supergroup is connected. Can't be a live location. */
location: Location;
/** Location address; 1-64 characters, as defined by the chat owner */
address: string;
}
/** This object represents a forum topic. */
export interface ForumTopic {
/** Unique identifier of the forum topic */
message_thread_id: number;
/** Name of the topic */
name: string;
/** Color of the topic icon in RGB format */
icon_color: number;
/** Unique identifier of the custom emoji shown as the topic icon */
icon_custom_emoji_id?: string;
/** Unique identifier of the forum topic */
message_thread_id: number;
/** Name of the topic */
name: string;
/** Color of the topic icon in RGB format */
icon_color: number;
/** Unique identifier of the custom emoji shown as the topic icon */
icon_custom_emoji_id?: string;
}
/** This object represents a bot command. */
export interface BotCommand {
/** Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. */
command: string;
/** Description of the command; 1-256 characters. */
description: string;
/** Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. */
command: string;
/** Description of the command; 1-256 characters. */
description: string;
}
/** This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile. */
export interface File {
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** File size in bytes */
file_size?: number;
/** File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */
file_path?: string;
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** File size in bytes */
file_size?: number;
/** File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */
file_path?: string;
}

@@ -1,87 +0,74 @@

import { ChatAdministratorRights, User } from "./manage";
import { Message } from "./message";
import type { ChatAdministratorRights, User } from "./manage.js";
import type { Message } from "./message.js";
/** This object represents an inline keyboard that appears right next to the message it belongs to. */
export interface InlineKeyboardMarkup {
/** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
inline_keyboard: InlineKeyboardButton[][];
/** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
inline_keyboard: InlineKeyboardButton[][];
}
export namespace InlineKeyboardButton {
interface AbstractInlineKeyboardButton {
/** Label text on the button */
text: string;
}
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. */
url: string;
}
export interface CallbackButton extends AbstractInlineKeyboardButton {
/** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */
callback_data: string;
}
export interface WebAppButton extends AbstractInlineKeyboardButton {
/** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. */
web_app: WebAppInfo;
}
export interface LoginButton extends AbstractInlineKeyboardButton {
/** An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. */
login_url: LoginUrl;
}
export interface SwitchInlineButton extends AbstractInlineKeyboardButton {
/** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted.
Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm... actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen. */
switch_inline_query: string;
}
export interface SwitchInlineCurrentChatButton
extends AbstractInlineKeyboardButton {
/** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.
This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. */
switch_inline_query_current_chat: string;
}
export interface GameButton extends AbstractInlineKeyboardButton {
/** Description of the game that will be launched when the user presses the button.
NOTE: This type of button must always be the first button in the first row. */
callback_game: CallbackGame;
}
export interface PayButton extends AbstractInlineKeyboardButton {
/** Specify True, to send a Pay button.
NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
pay: boolean;
}
export declare namespace InlineKeyboardButton {
interface AbstractInlineKeyboardButton {
/** Label text on the button */
text: string;
}
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. */
url: string;
}
export interface CallbackButton extends AbstractInlineKeyboardButton {
/** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */
callback_data: string;
}
export interface WebAppButton extends AbstractInlineKeyboardButton {
/** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. */
web_app: WebAppInfo;
}
export interface LoginButton extends AbstractInlineKeyboardButton {
/** An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. */
login_url: LoginUrl;
}
export interface SwitchInlineButton extends AbstractInlineKeyboardButton {
/** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted.
Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm... actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen. */
switch_inline_query: string;
}
export interface SwitchInlineCurrentChatButton extends AbstractInlineKeyboardButton {
/** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.
This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. */
switch_inline_query_current_chat: string;
}
export interface GameButton extends AbstractInlineKeyboardButton {
/** Description of the game that will be launched when the user presses the button.
NOTE: This type of button must always be the first button in the first row. */
callback_game: CallbackGame;
}
export interface PayButton extends AbstractInlineKeyboardButton {
/** Specify True, to send a Pay button.
NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
pay: boolean;
}
export {};
}
/** This object represents one button of an inline keyboard. You must use exactly one of the optional fields. */
export type InlineKeyboardButton =
| InlineKeyboardButton.CallbackButton
| InlineKeyboardButton.GameButton
| InlineKeyboardButton.LoginButton
| InlineKeyboardButton.PayButton
| InlineKeyboardButton.SwitchInlineButton
| InlineKeyboardButton.SwitchInlineCurrentChatButton
| InlineKeyboardButton.UrlButton
| InlineKeyboardButton.WebAppButton;
export type InlineKeyboardButton = InlineKeyboardButton.CallbackButton | InlineKeyboardButton.GameButton | InlineKeyboardButton.LoginButton | InlineKeyboardButton.PayButton | InlineKeyboardButton.SwitchInlineButton | InlineKeyboardButton.SwitchInlineCurrentChatButton | InlineKeyboardButton.UrlButton | InlineKeyboardButton.WebAppButton;
/** This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in.
Telegram apps support these buttons as of version 5.7. */
export interface LoginUrl {
/** An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.
NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. */
url: string;
/** New text of the button in forwarded messages. */
forward_text?: string;
/** Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. */
bot_username?: string;
/** Pass True to request the permission for your bot to send messages to the user. */
request_write_access?: boolean;
/** An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.
NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. */
url: string;
/** New text of the button in forwarded messages. */
forward_text?: string;
/** Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. */
bot_username?: string;
/** Pass True to request the permission for your bot to send messages to the user. */
request_write_access?: boolean;
}
/** A placeholder, currently holds no information. Use BotFather to set up your game. */
export interface CallbackGame {}
export interface CallbackGame {
}
/** This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

@@ -91,94 +78,80 @@

export interface CallbackQuery {
/** Unique identifier for this query */
id: string;
/** Sender */
from: User;
/** Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old */
message?: Message;
/** Identifier of the message sent via the bot in inline mode, that originated the query. */
inline_message_id?: string;
/** Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. */
chat_instance: string;
/** Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data. */
data?: string;
/** Short name of a Game to be returned, serves as the unique identifier for the game */
game_short_name?: string;
/** Unique identifier for this query */
id: string;
/** Sender */
from: User;
/** Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old */
message?: Message;
/** Identifier of the message sent via the bot in inline mode, that originated the query. */
inline_message_id?: string;
/** Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. */
chat_instance: string;
/** Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data. */
data?: string;
/** Short name of a Game to be returned, serves as the unique identifier for the game */
game_short_name?: string;
}
/** This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). */
export interface ReplyKeyboardMarkup {
/** Array of button rows, each represented by an Array of KeyboardButton objects */
keyboard: KeyboardButton[][];
/** Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon. */
is_persistent?: boolean;
/** Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. */
resize_keyboard?: boolean;
/** Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false. */
one_time_keyboard?: boolean;
/** The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */
input_field_placeholder?: string;
/** Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. */
selective?: boolean;
/** Array of button rows, each represented by an Array of KeyboardButton objects */
keyboard: KeyboardButton[][];
/** Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon. */
is_persistent?: boolean;
/** Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. */
resize_keyboard?: boolean;
/** Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false. */
one_time_keyboard?: boolean;
/** The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */
input_field_placeholder?: string;
/** Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. */
selective?: boolean;
}
export namespace KeyboardButton {
export interface CommonButton {
/** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed */
text: string;
}
export interface RequestUserButton extends CommonButton {
/** If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only. */
request_user: KeyboardButtonRequestUser;
}
export interface RequestChatButton extends CommonButton {
/** If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. */
request_chat: KeyboardButtonRequestChat;
}
export interface RequestContactButton extends CommonButton {
/** If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. */
request_contact: boolean;
}
export interface RequestLocationButton extends CommonButton {
/** If True, the user's current location will be sent when the button is pressed. Available in private chats only. */
request_location: boolean;
}
export interface RequestPollButton extends CommonButton {
/** If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only. */
request_poll: KeyboardButtonPollType;
}
export interface WebAppButton extends CommonButton {
/** If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only. */
web_app: WebAppInfo;
}
export declare namespace KeyboardButton {
interface CommonButton {
/** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed */
text: string;
}
interface RequestUserButton extends CommonButton {
/** If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only. */
request_user: KeyboardButtonRequestUser;
}
interface RequestChatButton extends CommonButton {
/** If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. */
request_chat: KeyboardButtonRequestChat;
}
interface RequestContactButton extends CommonButton {
/** If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. */
request_contact: boolean;
}
interface RequestLocationButton extends CommonButton {
/** If True, the user's current location will be sent when the button is pressed. Available in private chats only. */
request_location: boolean;
}
interface RequestPollButton extends CommonButton {
/** If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only. */
request_poll: KeyboardButtonPollType;
}
interface WebAppButton extends CommonButton {
/** If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only. */
web_app: WebAppInfo;
}
}
/** This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive. */
export type KeyboardButton =
| KeyboardButton.CommonButton
| KeyboardButton.RequestUserButton
| KeyboardButton.RequestChatButton
| KeyboardButton.RequestContactButton
| KeyboardButton.RequestLocationButton
| KeyboardButton.RequestPollButton
| KeyboardButton.WebAppButton
| string;
export type KeyboardButton = KeyboardButton.CommonButton | KeyboardButton.RequestUserButton | KeyboardButton.RequestChatButton | KeyboardButton.RequestContactButton | KeyboardButton.RequestLocationButton | KeyboardButton.RequestPollButton | KeyboardButton.WebAppButton | string;
/** This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. */
export interface KeyboardButtonPollType {
/** If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. */
type?: "quiz" | "regular";
/** If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. */
type?: "quiz" | "regular";
}
/** Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). */
export interface ReplyKeyboardRemove {
/** Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) */
remove_keyboard: true;
/** Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet. */
selective?: boolean;
/** Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) */
remove_keyboard: true;
/** Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet. */
selective?: boolean;
}
/** Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.

@@ -194,44 +167,41 @@

export interface ForceReply {
/** Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' */
force_reply: true;
/** The placeholder to be shown in the input field when the reply is active; 1-64 characters */
input_field_placeholder?: string;
/** Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. */
selective?: boolean;
/** Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' */
force_reply: true;
/** The placeholder to be shown in the input field when the reply is active; 1-64 characters */
input_field_placeholder?: string;
/** Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. */
selective?: boolean;
}
/** Describes a Web App. */
export interface WebAppInfo {
/** An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps */
url: string;
/** An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps */
url: string;
}
/** This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. */
export interface KeyboardButtonRequestUser {
/** Signed 32-bit identifier of the request */
request_id: number;
/** Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied. */
user_is_bot?: boolean;
/** Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied. */
user_is_premium?: boolean;
/** Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message */
request_id: number;
/** Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied. */
user_is_bot?: boolean;
/** Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied. */
user_is_premium?: boolean;
}
/** This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. */
export interface KeyboardButtonRequestChat {
/** Signed 32-bit identifier of the request */
request_id: number;
/** Pass True to request a channel chat, pass False to request a group or a supergroup chat. */
chat_is_channel: boolean;
/** Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied. */
chat_is_forum?: boolean;
/** Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied. */
chat_has_username?: boolean;
/** Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied. */
chat_is_created?: boolean;
/** A JSON-serialized object listing the required administrator rights of the user in the chat. If not specified, no additional restrictions are applied. */
user_administrator_rights?: ChatAdministratorRights;
/** A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied. */
bot_administrator_rights?: ChatAdministratorRights;
/** Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. */
bot_is_member?: boolean;
/** Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message */
request_id: number;
/** Pass True to request a channel chat, pass False to request a group or a supergroup chat. */
chat_is_channel: boolean;
/** Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied. */
chat_is_forum?: boolean;
/** Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied. */
chat_has_username?: boolean;
/** Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied. */
chat_is_created?: boolean;
/** An object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied. */
user_administrator_rights?: ChatAdministratorRights;
/** An object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied. */
bot_administrator_rights?: ChatAdministratorRights;
/** Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. */
bot_is_member?: boolean;
}

@@ -1,271 +0,220 @@

import { InlineKeyboardMarkup } from "./markup";
import { Chat, File, User } from "./manage";
import { PassportData } from "./passport";
import { Invoice, SuccessfulPayment } from "./payment";
import type { InlineKeyboardMarkup } from "./markup.js";
import type { Chat, File, User } from "./manage.js";
import type { PassportData } from "./passport.js";
import type { Invoice, SuccessfulPayment } from "./payment.js";
type MsgWith<P extends keyof Message> = Record<P, NonNullable<Message[P]>>;
export namespace Message {
interface ServiceMessage {
/** Unique message identifier inside this chat */
message_id: number;
/** Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only */
message_thread_id?: number;
/** Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
from?: User;
/** Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
sender_chat?: Chat;
/** Date the message was sent in Unix time */
date: number;
/** Conversation the message belongs to */
chat: Chat;
/** True, if the message is sent to a forum topic */
is_topic_message?: boolean;
}
interface CommonMessage extends ServiceMessage {
/** For forwarded messages, sender of the original message */
forward_from?: User;
/** For messages forwarded from channels or from anonymous administrators, information about the original sender chat */
forward_from_chat?: Chat;
/** For messages forwarded from channels, identifier of the original message in the channel */
forward_from_message_id?: number;
/** For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present */
forward_signature?: string;
/** Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages */
forward_sender_name?: string;
/** For forwarded messages, date the original message was sent in Unix time */
forward_date?: number;
/** True, if the message is a channel post that was automatically forwarded to the connected discussion group */
is_automatic_forward?: true;
/** For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */
reply_to_message?: ReplyMessage;
/** Bot through which the message was sent */
via_bot?: User;
/** Date the message was last edited in Unix time */
edit_date?: number;
/** True, if the message can't be forwarded */
has_protected_content?: true;
/** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
author_signature?: string;
/** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
reply_markup?: InlineKeyboardMarkup;
}
export interface CaptionableMessage extends CommonMessage {
/** Caption for the animation, audio, document, photo, video or voice */
caption?: string;
/** For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */
caption_entities?: MessageEntity[];
}
interface MediaMessage extends CaptionableMessage {
/** The unique identifier of a media message group this message belongs to */
media_group_id?: string;
/** True, if the message media is covered by a spoiler animation */
has_media_spoiler?: true;
}
export type TextMessage = CommonMessage & MsgWith<"text">;
export type AudioMessage = CaptionableMessage & MsgWith<"audio">;
export type DocumentMessage = CaptionableMessage & MsgWith<"document">;
export type AnimationMessage = DocumentMessage & MsgWith<"animation">;
export type PhotoMessage = MediaMessage & MsgWith<"photo">;
export type StickerMessage = CommonMessage & MsgWith<"sticker">;
export type VideoMessage = MediaMessage & MsgWith<"video">;
export type VideoNoteMessage = CommonMessage & MsgWith<"video_note">;
export type VoiceMessage = CaptionableMessage & MsgWith<"voice">;
export type ContactMessage = CommonMessage & MsgWith<"contact">;
export type DiceMessage = CommonMessage & MsgWith<"dice">;
export type GameMessage = CommonMessage & MsgWith<"game">;
export type PollMessage = CommonMessage & MsgWith<"poll">;
export type LocationMessage = CommonMessage & MsgWith<"location">;
export type VenueMessage = LocationMessage & MsgWith<"venue">;
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 PinnedMessageMessage = ServiceMessage & MsgWith<"pinned_message">;
export type InvoiceMessage = ServiceMessage & MsgWith<"invoice">;
export type SuccessfulPaymentMessage =
& ServiceMessage
& MsgWith<"successful_payment">;
export type UserSharedMessage = ServiceMessage & MsgWith<"user_shared">;
export type ChatSharedMessage = ServiceMessage & MsgWith<"chat_shared">;
export type ConnectedWebsiteMessage =
& ServiceMessage
& MsgWith<"connected_website">;
export type WriteAccessAllowedMessage =
& ServiceMessage
& MsgWith<"write_access_allowed">;
export type PassportDataMessage = ServiceMessage & MsgWith<"passport_data">;
export type ProximityAlertTriggeredMessage =
& ServiceMessage
& MsgWith<"proximity_alert_triggered">;
export type ForumTopicCreatedMessage =
& ServiceMessage
& MsgWith<"forum_topic_created">;
export type ForumTopicEditedMessage =
& ServiceMessage
& MsgWith<"forum_topic_edited">;
export type ForumTopicClosedMessage =
& ServiceMessage
& MsgWith<"forum_topic_closed">;
export type ForumTopicReopenedMessage =
& ServiceMessage
& MsgWith<"forum_topic_reopened">;
export type GeneralForumTopicHiddenMessage =
& ServiceMessage
& MsgWith<"general_forum_topic_hidden">;
export type GeneralForumTopicUnhiddenMessage =
& ServiceMessage
& MsgWith<"general_forum_topic_unhidden">;
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">;
export declare namespace Message {
interface ServiceMessage {
/** Unique message identifier inside this chat */
message_id: number;
/** Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only */
message_thread_id?: number;
/** Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
from?: User;
/** Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
sender_chat?: Chat;
/** Date the message was sent in Unix time */
date: number;
/** Conversation the message belongs to */
chat: Chat;
/** True, if the message is sent to a forum topic */
is_topic_message?: boolean;
}
interface CommonMessage extends ServiceMessage {
/** For forwarded messages, sender of the original message */
forward_from?: User;
/** For messages forwarded from channels or from anonymous administrators, information about the original sender chat */
forward_from_chat?: Chat;
/** For messages forwarded from channels, identifier of the original message in the channel */
forward_from_message_id?: number;
/** For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present */
forward_signature?: string;
/** Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages */
forward_sender_name?: string;
/** For forwarded messages, date the original message was sent in Unix time */
forward_date?: number;
/** True, if the message is a channel post that was automatically forwarded to the connected discussion group */
is_automatic_forward?: true;
/** For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */
reply_to_message?: ReplyMessage;
/** Bot through which the message was sent */
via_bot?: User;
/** Date the message was last edited in Unix time */
edit_date?: number;
/** True, if the message can't be forwarded */
has_protected_content?: true;
/** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
author_signature?: string;
/** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
reply_markup?: InlineKeyboardMarkup;
}
export interface CaptionableMessage extends CommonMessage {
/** Caption for the animation, audio, document, photo, video or voice */
caption?: string;
/** For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */
caption_entities?: MessageEntity[];
}
export interface MediaMessage extends CaptionableMessage {
/** The unique identifier of a media message group this message belongs to */
media_group_id?: string;
/** True, if the message media is covered by a spoiler animation */
has_media_spoiler?: true;
}
export type TextMessage = CommonMessage & MsgWith<"text">;
export type AudioMessage = CaptionableMessage & MsgWith<"audio">;
export type DocumentMessage = CaptionableMessage & MsgWith<"document">;
export type AnimationMessage = DocumentMessage & MsgWith<"animation">;
export type PhotoMessage = MediaMessage & MsgWith<"photo">;
export type StickerMessage = CommonMessage & MsgWith<"sticker">;
export type VideoMessage = MediaMessage & MsgWith<"video">;
export type VideoNoteMessage = CommonMessage & MsgWith<"video_note">;
export type VoiceMessage = CaptionableMessage & MsgWith<"voice">;
export type ContactMessage = CommonMessage & MsgWith<"contact">;
export type DiceMessage = CommonMessage & MsgWith<"dice">;
export type GameMessage = CommonMessage & MsgWith<"game">;
export type PollMessage = CommonMessage & MsgWith<"poll">;
export type LocationMessage = CommonMessage & MsgWith<"location">;
export type VenueMessage = LocationMessage & MsgWith<"venue">;
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 PinnedMessageMessage = ServiceMessage & MsgWith<"pinned_message">;
export type InvoiceMessage = ServiceMessage & MsgWith<"invoice">;
export type SuccessfulPaymentMessage = ServiceMessage & MsgWith<"successful_payment">;
export type UserSharedMessage = ServiceMessage & MsgWith<"user_shared">;
export type ChatSharedMessage = ServiceMessage & MsgWith<"chat_shared">;
export type ConnectedWebsiteMessage = ServiceMessage & MsgWith<"connected_website">;
export type WriteAccessAllowedMessage = ServiceMessage & MsgWith<"write_access_allowed">;
export type PassportDataMessage = ServiceMessage & MsgWith<"passport_data">;
export type ProximityAlertTriggeredMessage = ServiceMessage & MsgWith<"proximity_alert_triggered">;
export type ForumTopicCreatedMessage = ServiceMessage & MsgWith<"forum_topic_created">;
export type ForumTopicEditedMessage = ServiceMessage & MsgWith<"forum_topic_edited">;
export type ForumTopicClosedMessage = ServiceMessage & MsgWith<"forum_topic_closed">;
export type ForumTopicReopenedMessage = ServiceMessage & MsgWith<"forum_topic_reopened">;
export type GeneralForumTopicHiddenMessage = ServiceMessage & MsgWith<"general_forum_topic_hidden">;
export type GeneralForumTopicUnhiddenMessage = ServiceMessage & MsgWith<"general_forum_topic_unhidden">;
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">;
export {};
}
type ReplyMessage = Message & { reply_to_message: undefined };
type ReplyMessage = Message & {
reply_to_message: undefined;
};
export interface Message extends Message.MediaMessage {
/** For text messages, the actual UTF-8 text of the message */
text?: string;
/** For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text */
entities?: MessageEntity[];
/** Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set */
animation?: Animation;
/** Message is an audio file, information about the file */
audio?: Audio;
/** Message is a general file, information about the file */
document?: Document;
/** Message is a photo, available sizes of the photo */
photo?: PhotoSize[];
/** Message is a sticker, information about the sticker */
sticker?: Sticker;
/** Message is a video, information about the video */
video?: Video;
/** Message is a video note, information about the video message */
video_note?: VideoNote;
/** Message is a voice message, information about the file */
voice?: Voice;
/** Message is a shared contact, information about the contact */
contact?: Contact;
/** Message is a dice with random value */
dice?: Dice;
/** Message is a game, information about the game. More about games » */
game?: Game;
/** Message is a native poll, information about the poll */
poll?: Poll;
/** Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set */
venue?: Venue;
/** Message is a shared location, information about the location */
location?: Location;
/** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
new_chat_members?: User[];
/** A member was removed from the group, information about them (this member may be the bot itself) */
left_chat_member?: User;
/** A chat title was changed to this value */
new_chat_title?: string;
/** A chat photo was change to this value */
new_chat_photo?: PhotoSize[];
/** Service message: the chat photo was deleted */
delete_chat_photo?: true;
/** Service message: the group has been created */
group_chat_created?: true;
/** Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. */
supergroup_chat_created?: true;
/** Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. */
channel_chat_created?: true;
/** Service message: auto-delete timer settings changed in the chat */
message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged;
/** 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. */
migrate_to_chat_id?: number;
/** The supergroup has been migrated from a group 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. */
migrate_from_chat_id?: number;
/** Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. */
pinned_message?: ReplyMessage;
/** Message is an invoice for a payment, information about the invoice. More about payments » */
invoice?: Invoice;
/** Message is a service message about a successful payment, information about the payment. More about payments » */
successful_payment?: SuccessfulPayment;
/** Service message: a user was shared with the bot */
user_shared?: UserShared;
/** Service message: a chat was shared with the bot */
chat_shared?: ChatShared;
/** The domain name of the website on which the user has logged in. More about Telegram Login » */
connected_website?: string;
/** Service message: the user allowed the bot added to the attachment menu to write messages */
write_access_allowed?: WriteAccessAllowed;
/** Telegram Passport data */
passport_data?: PassportData;
/** Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. */
proximity_alert_triggered?: ProximityAlertTriggered;
/** Service message: forum topic created */
forum_topic_created?: ForumTopicCreated;
/** Service message: forum topic edited */
forum_topic_edited?: ForumTopicEdited;
/** Service message: forum topic closed */
forum_topic_closed?: ForumTopicClosed;
/** Service message: forum topic reopened */
forum_topic_reopened?: ForumTopicReopened;
/** Service message: the 'General' forum topic hidden */
general_forum_topic_hidden?: GeneralForumTopicHidden;
/** Service message: the 'General' forum topic unhidden */
general_forum_topic_unhidden?: GeneralForumTopicUnhidden;
/** Service message: video chat scheduled */
video_chat_scheduled?: VideoChatScheduled;
/** Service message: video chat started */
video_chat_started?: VideoChatStarted;
/** Service message: video chat ended */
video_chat_ended?: VideoChatEnded;
/** Service message: new participants invited to a video chat */
video_chat_participants_invited?: VideoChatParticipantsInvited;
/** Service message: data sent by a Web App */
web_app_data?: WebAppData;
/** For text messages, the actual UTF-8 text of the message */
text?: string;
/** For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text */
entities?: MessageEntity[];
/** Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set */
animation?: Animation;
/** Message is an audio file, information about the file */
audio?: Audio;
/** Message is a general file, information about the file */
document?: Document;
/** Message is a photo, available sizes of the photo */
photo?: PhotoSize[];
/** Message is a sticker, information about the sticker */
sticker?: Sticker;
/** Message is a video, information about the video */
video?: Video;
/** Message is a video note, information about the video message */
video_note?: VideoNote;
/** Message is a voice message, information about the file */
voice?: Voice;
/** Message is a shared contact, information about the contact */
contact?: Contact;
/** Message is a dice with random value */
dice?: Dice;
/** Message is a game, information about the game. More about games » */
game?: Game;
/** Message is a native poll, information about the poll */
poll?: Poll;
/** Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set */
venue?: Venue;
/** Message is a shared location, information about the location */
location?: Location;
/** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
new_chat_members?: User[];
/** A member was removed from the group, information about them (this member may be the bot itself) */
left_chat_member?: User;
/** A chat title was changed to this value */
new_chat_title?: string;
/** A chat photo was change to this value */
new_chat_photo?: PhotoSize[];
/** Service message: the chat photo was deleted */
delete_chat_photo?: true;
/** Service message: the group has been created */
group_chat_created?: true;
/** Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. */
supergroup_chat_created?: true;
/** Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. */
channel_chat_created?: true;
/** Service message: auto-delete timer settings changed in the chat */
message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged;
/** 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. */
migrate_to_chat_id?: number;
/** The supergroup has been migrated from a group 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. */
migrate_from_chat_id?: number;
/** Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. */
pinned_message?: ReplyMessage;
/** Message is an invoice for a payment, information about the invoice. More about payments » */
invoice?: Invoice;
/** Message is a service message about a successful payment, information about the payment. More about payments » */
successful_payment?: SuccessfulPayment;
/** Service message: a user was shared with the bot */
user_shared?: UserShared;
/** Service message: a chat was shared with the bot */
chat_shared?: ChatShared;
/** The domain name of the website on which the user has logged in. More about Telegram Login » */
connected_website?: string;
/** Service message: the user allowed the bot added to the attachment menu to write messages */
write_access_allowed?: WriteAccessAllowed;
/** Telegram Passport data */
passport_data?: PassportData;
/** Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. */
proximity_alert_triggered?: ProximityAlertTriggered;
/** Service message: forum topic created */
forum_topic_created?: ForumTopicCreated;
/** Service message: forum topic edited */
forum_topic_edited?: ForumTopicEdited;
/** Service message: forum topic closed */
forum_topic_closed?: ForumTopicClosed;
/** Service message: forum topic reopened */
forum_topic_reopened?: ForumTopicReopened;
/** Service message: the 'General' forum topic hidden */
general_forum_topic_hidden?: GeneralForumTopicHidden;
/** Service message: the 'General' forum topic unhidden */
general_forum_topic_unhidden?: GeneralForumTopicUnhidden;
/** Service message: video chat scheduled */
video_chat_scheduled?: VideoChatScheduled;
/** Service message: video chat started */
video_chat_started?: VideoChatStarted;
/** Service message: video chat ended */
video_chat_ended?: VideoChatEnded;
/** Service message: new participants invited to a video chat */
video_chat_participants_invited?: VideoChatParticipantsInvited;
/** Service message: data sent by a Web App */
web_app_data?: WebAppData;
}
/** This object represents a unique message identifier. */
export interface MessageId {
/** Unique message identifier */
message_id: number;
/** Unique message identifier */
message_id: number;
}
/** Describes an inline message sent by a Web App on behalf of a user. */
export interface SentWebAppMessage {
/** Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. */
inline_message_id: string;
/** Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. */
inline_message_id: string;
}
/** The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, and spoiler text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting.

@@ -361,468 +310,421 @@

export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
export namespace MessageEntity {
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), “custom_emoji” (for inline custom emoji stickers) */
type: string;
/** Offset in UTF-16 code units to the start of the entity */
offset: number;
/** Length of the entity in UTF-16 code units */
length: number;
}
export interface CommonMessageEntity extends AbstractMessageEntity {
type:
| "mention"
| "hashtag"
| "cashtag"
| "bot_command"
| "url"
| "email"
| "phone_number"
| "bold"
| "italic"
| "underline"
| "strikethrough"
| "spoiler"
| "code";
}
export interface PreMessageEntity extends AbstractMessageEntity {
type: "pre";
/** For “pre” only, the programming language of the entity text */
language?: string;
}
export interface TextLinkMessageEntity extends AbstractMessageEntity {
type: "text_link";
/** For “text_link” only, URL that will be opened after user taps on the text */
url: string;
}
export interface TextMentionMessageEntity extends AbstractMessageEntity {
type: "text_mention";
/** For “text_mention” only, the mentioned user */
user: User;
}
export interface CustomEmojiMessageEntity extends AbstractMessageEntity {
type: "custom_emoji";
/** For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker */
custom_emoji_id: string;
}
export declare namespace MessageEntity {
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), “custom_emoji” (for inline custom emoji stickers) */
type: string;
/** Offset in UTF-16 code units to the start of the entity */
offset: number;
/** Length of the entity in UTF-16 code units */
length: number;
}
export interface CommonMessageEntity extends AbstractMessageEntity {
type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "code";
}
export interface PreMessageEntity extends AbstractMessageEntity {
type: "pre";
/** For “pre” only, the programming language of the entity text */
language?: string;
}
export interface TextLinkMessageEntity extends AbstractMessageEntity {
type: "text_link";
/** For “text_link” only, URL that will be opened after user taps on the text */
url: string;
}
export interface TextMentionMessageEntity extends AbstractMessageEntity {
type: "text_mention";
/** For “text_mention” only, the mentioned user */
user: User;
}
export interface CustomEmojiMessageEntity extends AbstractMessageEntity {
type: "custom_emoji";
/** For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker */
custom_emoji_id: string;
}
export {};
}
/** This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. */
export type MessageEntity =
| MessageEntity.CommonMessageEntity
| MessageEntity.CustomEmojiMessageEntity
| MessageEntity.PreMessageEntity
| MessageEntity.TextLinkMessageEntity
| MessageEntity.TextMentionMessageEntity;
export type MessageEntity = MessageEntity.CommonMessageEntity | MessageEntity.CustomEmojiMessageEntity | MessageEntity.PreMessageEntity | MessageEntity.TextLinkMessageEntity | MessageEntity.TextMentionMessageEntity;
/** This object represents one size of a photo or a file / sticker thumbnail. */
export interface PhotoSize {
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Photo width */
width: number;
/** Photo height */
height: number;
/** File size in bytes */
file_size?: number;
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Photo width */
width: number;
/** Photo height */
height: number;
/** File size in bytes */
file_size?: number;
}
/** This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). */
export interface Animation {
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Video width as defined by sender */
width: number;
/** Video height as defined by sender */
height: number;
/** Duration of the video in seconds as defined by sender */
duration: number;
/** Animation thumbnail as defined by sender */
thumb?: PhotoSize;
/** Original animation filename as defined by sender */
file_name?: string;
/** MIME type of the file as defined by sender */
mime_type?: string;
/** File size in bytes */
file_size?: number;
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Video width as defined by sender */
width: number;
/** Video height as defined by sender */
height: number;
/** Duration of the video in seconds as defined by sender */
duration: number;
/** Animation thumbnail as defined by sender */
thumbnail?: PhotoSize;
/** Original animation filename as defined by sender */
file_name?: string;
/** MIME type of the file as defined by sender */
mime_type?: string;
/** File size in bytes */
file_size?: number;
}
/** This object represents an audio file to be treated as music by the Telegram clients. */
export interface Audio {
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Duration of the audio in seconds as defined by sender */
duration: number;
/** Performer of the audio as defined by sender or by audio tags */
performer?: string;
/** Title of the audio as defined by sender or by audio tags */
title?: string;
/** Original filename as defined by sender */
file_name?: string;
/** MIME type of the file as defined by sender */
mime_type?: string;
/** File size in bytes */
file_size?: number;
/** Thumbnail of the album cover to which the music file belongs */
thumb?: PhotoSize;
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Duration of the audio in seconds as defined by sender */
duration: number;
/** Performer of the audio as defined by sender or by audio tags */
performer?: string;
/** Title of the audio as defined by sender or by audio tags */
title?: string;
/** Original filename as defined by sender */
file_name?: string;
/** MIME type of the file as defined by sender */
mime_type?: string;
/** File size in bytes */
file_size?: number;
/** Thumbnail of the album cover to which the music file belongs */
thumbnail?: PhotoSize;
}
/** This object represents a general file (as opposed to photos, voice messages and audio files). */
export interface Document {
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Document thumbnail as defined by sender */
thumb?: PhotoSize;
/** Original filename as defined by sender */
file_name?: string;
/** MIME type of the file as defined by sender */
mime_type?: string;
/** File size in bytes */
file_size?: number;
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Document thumbnail as defined by sender */
thumbnail?: PhotoSize;
/** Original filename as defined by sender */
file_name?: string;
/** MIME type of the file as defined by sender */
mime_type?: string;
/** File size in bytes */
file_size?: number;
}
/** This object represents a video file. */
export interface Video {
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Video width as defined by sender */
width: number;
/** Video height as defined by sender */
height: number;
/** Duration of the video in seconds as defined by sender */
duration: number;
/** Video thumbnail */
thumb?: PhotoSize;
/** Original filename as defined by sender */
file_name?: string;
/** MIME type of the file as defined by sender */
mime_type?: string;
/** File size in bytes */
file_size?: number;
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Video width as defined by sender */
width: number;
/** Video height as defined by sender */
height: number;
/** Duration of the video in seconds as defined by sender */
duration: number;
/** Video thumbnail */
thumbnail?: PhotoSize;
/** Original filename as defined by sender */
file_name?: string;
/** MIME type of the file as defined by sender */
mime_type?: string;
/** File size in bytes */
file_size?: number;
}
/** This object represents a video message (available in Telegram apps as of v.4.0). */
export interface VideoNote {
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Video width and height (diameter of the video message) as defined by sender */
length: number;
/** Duration of the video in seconds as defined by sender */
duration: number;
/** Video thumbnail */
thumb?: PhotoSize;
/** File size in bytes */
file_size?: number;
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Video width and height (diameter of the video message) as defined by sender */
length: number;
/** Duration of the video in seconds as defined by sender */
duration: number;
/** Video thumbnail */
thumbnail?: PhotoSize;
/** File size in bytes */
file_size?: number;
}
/** This object represents a voice note. */
export interface Voice {
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Duration of the audio in seconds as defined by sender */
duration: number;
/** MIME type of the file as defined by sender */
mime_type?: string;
/** File size in bytes */
file_size?: number;
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Duration of the audio in seconds as defined by sender */
duration: number;
/** MIME type of the file as defined by sender */
mime_type?: string;
/** File size in bytes */
file_size?: number;
}
/** This object represents a phone contact. */
export interface Contact {
/** Contact's phone number */
phone_number: string;
/** Contact's first name */
first_name: string;
/** Contact's last name */
last_name?: string;
/** Contact's user identifier in Telegram. 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 64-bit integer or double-precision float type are safe for storing this identifier. */
user_id?: number;
/** Additional data about the contact in the form of a vCard */
vcard?: string;
/** Contact's phone number */
phone_number: string;
/** Contact's first name */
first_name: string;
/** Contact's last name */
last_name?: string;
/** Contact's user identifier in Telegram. 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 64-bit integer or double-precision float type are safe for storing this identifier. */
user_id?: number;
/** Additional data about the contact in the form of a vCard */
vcard?: string;
}
/** This object represents an animated emoji that displays a random value. */
export interface Dice {
/** Emoji on which the dice throw animation is based */
emoji: string;
/** Value of the dice, 1-6 for "🎲", "🎯" and "🎳" base emoji, 1-5 for "🏀" and "⚽" base emoji, 1-64 for "🎰" base emoji */
value: number;
/** Emoji on which the dice throw animation is based */
emoji: string;
/** Value of the dice, 1-6 for "🎲", "🎯" and "🎳" base emoji, 1-5 for "🏀" and "⚽" base emoji, 1-64 for "🎰" base emoji */
value: number;
}
/** This object contains information about one answer option in a poll. */
export interface PollOption {
/** Option text, 1-100 characters */
text: string;
/** Number of users that voted for this option */
voter_count: number;
/** Option text, 1-100 characters */
text: string;
/** Number of users that voted for this option */
voter_count: number;
}
/** This object represents an answer of a user in a non-anonymous poll. */
export interface PollAnswer {
/** Unique poll identifier */
poll_id: string;
/** The user, who changed the answer to the poll */
user: User;
/** 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. */
option_ids: number[];
/** Unique poll identifier */
poll_id: string;
/** The user, who changed the answer to the poll */
user: User;
/** 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. */
option_ids: number[];
}
/** This object contains information about a poll. */
export interface Poll {
/** Unique poll identifier */
id: string;
/** Poll question, 1-300 characters */
question: string;
/** List of poll options */
options: PollOption[];
/** Total number of users that voted in the poll */
total_voter_count: number;
/** True, if the poll is closed */
is_closed: boolean;
/** True, if the poll is anonymous */
is_anonymous: boolean;
/** Poll type, currently can be “regular” or “quiz” */
type: "regular" | "quiz";
/** True, if the poll allows multiple answers */
allows_multiple_answers: boolean;
/** 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. */
correct_option_id?: number;
/** Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters */
explanation?: string;
/** Special entities like usernames, URLs, bot commands, etc. that appear in the explanation */
explanation_entities?: MessageEntity[];
/** Amount of time in seconds the poll will be active after creation */
open_period?: number;
/** Point in time (Unix timestamp) when the poll will be automatically closed */
close_date?: number;
/** Unique poll identifier */
id: string;
/** Poll question, 1-300 characters */
question: string;
/** List of poll options */
options: PollOption[];
/** Total number of users that voted in the poll */
total_voter_count: number;
/** True, if the poll is closed */
is_closed: boolean;
/** True, if the poll is anonymous */
is_anonymous: boolean;
/** Poll type, currently can be “regular” or “quiz” */
type: "regular" | "quiz";
/** True, if the poll allows multiple answers */
allows_multiple_answers: boolean;
/** 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. */
correct_option_id?: number;
/** Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters */
explanation?: string;
/** Special entities like usernames, URLs, bot commands, etc. that appear in the explanation */
explanation_entities?: MessageEntity[];
/** Amount of time in seconds the poll will be active after creation */
open_period?: number;
/** Point in time (Unix timestamp) when the poll will be automatically closed */
close_date?: number;
}
/** This object represents a point on the map. */
export interface Location {
/** Longitude as defined by sender */
longitude: number;
/** Latitude as defined by sender */
latitude: number;
/** The radius of uncertainty for the location, measured in meters; 0-1500 */
horizontal_accuracy?: number;
/** Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. */
live_period?: number;
/** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
heading?: number;
/** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */
proximity_alert_radius?: number;
/** Longitude as defined by sender */
longitude: number;
/** Latitude as defined by sender */
latitude: number;
/** The radius of uncertainty for the location, measured in meters; 0-1500 */
horizontal_accuracy?: number;
/** Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. */
live_period?: number;
/** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
heading?: number;
/** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */
proximity_alert_radius?: number;
}
/** This object represents a venue. */
export interface Venue {
/** Venue location. Can't be a live location */
location: Location;
/** Name of the venue */
title: string;
/** Address of the venue */
address: string;
/** Foursquare identifier of the venue */
foursquare_id?: string;
/** Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */
foursquare_type?: string;
/** Google Places identifier of the venue */
google_place_id?: string;
/** Google Places type of the venue. (See supported types.) */
google_place_type?: string;
/** Venue location. Can't be a live location */
location: Location;
/** Name of the venue */
title: string;
/** Address of the venue */
address: string;
/** Foursquare identifier of the venue */
foursquare_id?: string;
/** Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */
foursquare_type?: string;
/** Google Places identifier of the venue */
google_place_id?: string;
/** Google Places type of the venue. (See supported types.) */
google_place_type?: string;
}
/** This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. */
export interface ProximityAlertTriggered {
/** User that triggered the alert */
traveler: User;
/** User that set the alert */
watcher: User;
/** The distance between the users */
distance: number;
/** User that triggered the alert */
traveler: User;
/** User that set the alert */
watcher: User;
/** The distance between the users */
distance: number;
}
/** This object represents a service message about a change in auto-delete timer settings. */
export interface MessageAutoDeleteTimerChanged {
/** New auto-delete time for messages in the chat; in seconds */
message_auto_delete_time: number;
/** New auto-delete time for messages in the chat; in seconds */
message_auto_delete_time: number;
}
/** This object represents a service message about a new forum topic created in the chat. */
export interface ForumTopicCreated {
/** Name of the topic */
name: string;
/** Color of the topic icon in RGB format */
icon_color: number;
/** Unique identifier of the custom emoji shown as the topic icon */
icon_custom_emoji_id?: string;
/** Name of the topic */
name: string;
/** Color of the topic icon in RGB format */
icon_color: number;
/** Unique identifier of the custom emoji shown as the topic icon */
icon_custom_emoji_id?: string;
}
/** This object represents a service message about an edited forum topic. */
export interface ForumTopicEdited {
/** New name of the topic, if it was edited */
name?: string;
/** New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed */
icon_custom_emoji_id?: string;
/** New name of the topic, if it was edited */
name?: string;
/** New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed */
icon_custom_emoji_id?: string;
}
/** This object represents a service message about a forum topic closed in the chat. Currently holds no information. */
export interface ForumTopicClosed {}
export interface ForumTopicClosed {
}
/** This object represents a service message about a forum topic reopened in the chat. Currently holds no information. */
export interface ForumTopicReopened {}
export interface ForumTopicReopened {
}
/** This object represents a service message about General forum topic hidden in the chat. Currently holds no information. */
export interface GeneralForumTopicHidden {}
export interface GeneralForumTopicHidden {
}
/** This object represents a service message about General forum topic unhidden in the chat. Currently holds no information. */
export interface GeneralForumTopicUnhidden {}
export interface GeneralForumTopicUnhidden {
}
/** This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button. */
export interface UserShared {
/** Identifier of the request */
request_id: number;
/** Identifier of the shared user. 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 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. */
user_id: number;
/** Identifier of the request */
request_id: number;
/** Identifier of the shared user. 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 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. */
user_id: number;
}
/** This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button. */
export interface ChatShared {
/** Identifier of the request */
request_id: number;
/** Identifier of the shared 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 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. */
chat_id: number;
/** Identifier of the request */
request_id: number;
/** Identifier of the shared 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 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. */
chat_id: number;
}
/** This object represents a service message about a user allowing a bot added to the attachment menu to write messages. Currently holds no information. */
export interface WriteAccessAllowed {}
export interface WriteAccessAllowed {
}
/** This object represents a service message about a video chat scheduled in the chat. */
export interface VideoChatScheduled {
/** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */
start_date: number;
/** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */
start_date: number;
}
/** This object represents a service message about a video chat started in the chat. Currently holds no information. */
export interface VideoChatStarted {}
export interface VideoChatStarted {
}
/** This object represents a service message about a video chat ended in the chat. */
export interface VideoChatEnded {
/** Video chat duration in seconds */
duration: number;
/** Video chat duration in seconds */
duration: number;
}
/** This object represents a service message about new members invited to a video chat. */
export interface VideoChatParticipantsInvited {
/** New members that were invited to the video chat */
users: User[];
/** New members that were invited to the video chat */
users: User[];
}
/** 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. */
button_text: string;
/** 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. */
button_text: string;
}
/** This object represents a sticker. */
export interface Sticker {
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. */
type: "regular" | "mask" | "custom_emoji";
/** Sticker width */
width: number;
/** Sticker height */
height: number;
/** True, if the sticker is animated */
is_animated: boolean;
/** True, if the sticker is a video sticker */
is_video: boolean;
/** Sticker thumbnail in the .WEBP or .JPG format */
thumb?: PhotoSize;
/** Emoji associated with the sticker */
emoji?: string;
/** Name of the sticker set to which the sticker belongs */
set_name?: string;
/** For premium regular stickers, premium animation for the sticker */
premium_animation?: File;
/** For mask stickers, the position where the mask should be placed */
mask_position?: MaskPosition;
/** For custom emoji stickers, unique identifier of the custom emoji */
custom_emoji_id?: string;
/** File size in bytes */
file_size?: number;
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. */
type: "regular" | "mask" | "custom_emoji";
/** Sticker width */
width: number;
/** Sticker height */
height: number;
/** True, if the sticker is animated */
is_animated: boolean;
/** True, if the sticker is a video sticker */
is_video: boolean;
/** Sticker thumbnail in the .WEBP or .JPG format */
thumbnail?: PhotoSize;
/** Emoji associated with the sticker */
emoji?: string;
/** Name of the sticker set to which the sticker belongs */
set_name?: string;
/** For premium regular stickers, premium animation for the sticker */
premium_animation?: File;
/** For mask stickers, the position where the mask should be placed */
mask_position?: MaskPosition;
/** For custom emoji stickers, unique identifier of the custom emoji */
custom_emoji_id?: string;
/** File size in bytes */
file_size?: number;
}
/** This object represents a sticker set. */
export interface StickerSet {
/** Sticker set name */
name: string;
/** Sticker set title */
title: string;
/** Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” */
sticker_type: "regular" | "mask" | "custom_emoji";
/** True, if the sticker set contains animated stickers */
is_animated: boolean;
/** True, if the sticker set contains video stickers */
is_video: boolean;
/** List of all set stickers */
stickers: Sticker[];
/** Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */
thumb?: PhotoSize;
/** Sticker set name */
name: string;
/** Sticker set title */
title: string;
/** Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” */
sticker_type: "regular" | "mask" | "custom_emoji";
/** True, if the sticker set contains animated stickers */
is_animated: boolean;
/** True, if the sticker set contains video stickers */
is_video: boolean;
/** List of all set stickers */
stickers: Sticker[];
/** Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */
thumbnail?: PhotoSize;
}
/** This object describes the position on faces where a mask should be placed by default. */
export interface MaskPosition {
/** 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";
/** 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. */
x_shift: number;
/** Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. */
y_shift: number;
/** Mask scaling coefficient. For example, 2.0 means double size. */
scale: number;
/** 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";
/** 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. */
x_shift: number;
/** Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. */
y_shift: number;
/** Mask scaling coefficient. For example, 2.0 means double size. */
scale: number;
}
/** This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. */
export interface Game {
/** Title of the game */
title: string;
/** Description of the game */
description: string;
/** Photo that will be displayed in the game message in chats. */
photo: PhotoSize[];
/** Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters. */
text: string;
/** Special entities that appear in text, such as usernames, URLs, bot commands, etc. */
text_entities: MessageEntity[];
/** Animation that will be displayed in the game message in chats. Upload via BotFather */
animation: Animation;
/** Title of the game */
title: string;
/** Description of the game */
description: string;
/** Photo that will be displayed in the game message in chats. */
photo: PhotoSize[];
/** Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters. */
text: string;
/** Special entities that appear in text, such as usernames, URLs, bot commands, etc. */
text_entities: MessageEntity[];
/** Animation that will be displayed in the game message in chats. Upload via BotFather */
animation: Animation;
}
/** This object represents one row of the high scores table for a game. */
export interface GameHighScore {
/** Position in high score table for the game */
position: number;
/** User */
user: User;
/** Score */
score: number;
/** Position in high score table for the game */
position: number;
/** User */
user: User;
/** Score */
score: number;
}
export {};
{
"name": "@grammyjs/types",
"version": "2.12.1",
"version": "3.0.0",
"description": "Telegram Bot API type declarations for grammY",
"main": "index.js",
"main": "mod.js",
"repository": {

@@ -17,9 +17,19 @@ "type": "git",

],
"scripts": {
"prepare": "deno task backport"
},
"author": "KnorpelSenf",
"types": "index.d.ts",
"types": "mod.d.ts",
"license": "MIT",
"bugs": {
"url": "https://github.com/grammyjs/grammy/issues"
"url": "https://github.com/grammyjs/types/issues"
},
"homepage": "https://grammy.dev/"
"files": [
"*.d.ts",
"mod.js"
],
"homepage": "https://grammy.dev/",
"devDependencies": {
"deno-bin": "^1.31.1"
}
}
/** Describes Telegram Passport data shared with the bot by the user. */
export interface PassportData {
/** Array with information about documents and other Telegram Passport elements that was shared with the bot */
data: EncryptedPassportElement[];
/** Encrypted credentials required to decrypt the data */
credentials: EncryptedCredentials;
/** Array with information about documents and other Telegram Passport elements that was shared with the bot */
data: EncryptedPassportElement[];
/** Encrypted credentials required to decrypt the data */
credentials: EncryptedCredentials;
}
/** This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB. */
export interface PassportFile {
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** File size in bytes */
file_size: number;
/** Unix time when the file was uploaded */
file_date: number;
/** Identifier for this file, which can be used to download or reuse the file */
file_id: string;
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
file_unique_id: string;
/** File size in bytes */
file_size: number;
/** Unix time when the file was uploaded */
file_date: number;
}
/** 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”. */
type:
| "personal_details"
| "passport"
| "driver_license"
| "identity_card"
| "internal_passport"
| "address"
| "utility_bill"
| "bank_statement"
| "rental_agreement"
| "passport_registration"
| "temporary_registration"
| "phone_number"
| "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. */
data?: string;
/** User's verified phone number, available only for “phone_number” type */
phone_number?: string;
/** 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. */
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. */
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. */
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. */
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. */
translation?: PassportFile[];
/** Base64-encoded element hash for using in PassportElementErrorUnspecified */
hash: string;
/** 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: "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" | "phone_number" | "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. */
data?: string;
/** User's verified phone number, available only for “phone_number” type */
phone_number?: string;
/** 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. */
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. */
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. */
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. */
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. */
translation?: PassportFile[];
/** Base64-encoded element hash for using in PassportElementErrorUnspecified */
hash: string;
}
/** 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 {
/** Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication */
data: string;
/** Base64-encoded data hash for data authentication */
hash: string;
/** Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption */
secret: string;
/** Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication */
data: string;
/** Base64-encoded data hash for data authentication */
hash: string;
/** Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption */
secret: string;
}
/** This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:

@@ -79,155 +62,103 @@ - PassportElementErrorDataField

*/
export type PassportElementError =
| PassportElementErrorDataField
| PassportElementErrorFrontSide
| PassportElementErrorReverseSide
| PassportElementErrorSelfie
| PassportElementErrorFile
| PassportElementErrorFiles
| PassportElementErrorTranslationFile
| PassportElementErrorTranslationFiles
| PassportElementErrorUnspecified;
export type PassportElementError = PassportElementErrorDataField | PassportElementErrorFrontSide | PassportElementErrorReverseSide | PassportElementErrorSelfie | PassportElementErrorFile | PassportElementErrorFiles | PassportElementErrorTranslationFile | PassportElementErrorTranslationFiles | PassportElementErrorUnspecified;
/** Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes. */
export interface PassportElementErrorDataField {
/** Error source, must be data */
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” */
type:
| "personal_details"
| "passport"
| "driver_license"
| "identity_card"
| "internal_passport"
| "address";
/** Name of the data field which has the error */
field_name: string;
/** Base64-encoded data hash */
data_hash: string;
/** Error message */
message: string;
/** Error source, must be data */
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” */
type: "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address";
/** Name of the data field which has the error */
field_name: string;
/** Base64-encoded data hash */
data_hash: string;
/** Error message */
message: string;
}
/** Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes. */
export interface PassportElementErrorFrontSide {
/** Error source, must be front_side */
source: "front_side";
/** 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";
/** Base64-encoded hash of the file with the front side of the document */
file_hash: string;
/** Error message */
message: string;
/** Error source, must be front_side */
source: "front_side";
/** 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";
/** Base64-encoded hash of the file with the front side of the document */
file_hash: string;
/** Error message */
message: string;
}
/** Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes. */
export interface PassportElementErrorReverseSide {
/** Error source, must be reverse_side */
source: "reverse_side";
/** The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card” */
type: "driver_license" | "identity_card";
/** Base64-encoded hash of the file with the reverse side of the document */
file_hash: string;
/** Error message */
message: string;
/** Error source, must be reverse_side */
source: "reverse_side";
/** The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card” */
type: "driver_license" | "identity_card";
/** Base64-encoded hash of the file with the reverse side of the document */
file_hash: string;
/** Error message */
message: string;
}
/** Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes. */
export interface PassportElementErrorSelfie {
/** Error source, must be selfie */
source: "selfie";
/** 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";
/** Base64-encoded hash of the file with the selfie */
file_hash: string;
/** Error message */
message: string;
/** Error source, must be selfie */
source: "selfie";
/** 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";
/** Base64-encoded hash of the file with the selfie */
file_hash: string;
/** Error message */
message: string;
}
/** Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes. */
export interface PassportElementErrorFile {
/** Error source, must be file */
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” */
type:
| "utility_bill"
| "bank_statement"
| "rental_agreement"
| "passport_registration"
| "temporary_registration";
/** Base64-encoded file hash */
file_hash: string;
/** Error message */
message: string;
/** Error source, must be file */
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” */
type: "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration";
/** Base64-encoded file hash */
file_hash: string;
/** Error message */
message: string;
}
/** Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes. */
export interface PassportElementErrorFiles {
/** Error source, must be files */
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” */
type:
| "utility_bill"
| "bank_statement"
| "rental_agreement"
| "passport_registration"
| "temporary_registration";
/** List of base64-encoded file hashes */
file_hashes: string[];
/** Error message */
message: string;
/** Error source, must be files */
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” */
type: "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration";
/** List of base64-encoded file hashes */
file_hashes: string[];
/** Error message */
message: string;
}
/** Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. */
export interface PassportElementErrorTranslationFile {
/** Error source, must be translation_file */
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:
| "passport"
| "driver_license"
| "identity_card"
| "internal_passport"
| "utility_bill"
| "bank_statement"
| "rental_agreement"
| "passport_registration"
| "temporary_registration";
/** Base64-encoded file hash */
file_hash: string;
/** Error message */
message: string;
/** Error source, must be translation_file */
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: "passport" | "driver_license" | "identity_card" | "internal_passport" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration";
/** Base64-encoded file hash */
file_hash: string;
/** Error message */
message: string;
}
/** Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change. */
export interface PassportElementErrorTranslationFiles {
/** Error source, must be translation_files */
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:
| "passport"
| "driver_license"
| "identity_card"
| "internal_passport"
| "utility_bill"
| "bank_statement"
| "rental_agreement"
| "passport_registration"
| "temporary_registration";
/** List of base64-encoded file hashes */
file_hashes: string[];
/** Error message */
message: string;
/** Error source, must be translation_files */
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: "passport" | "driver_license" | "identity_card" | "internal_passport" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration";
/** List of base64-encoded file hashes */
file_hashes: string[];
/** Error message */
message: string;
}
/** Represents an issue in an unspecified place. The error is considered resolved when new data is added. */
export interface PassportElementErrorUnspecified {
/** Error source, must be unspecified */
source: "unspecified";
/** Type of element of the user's Telegram Passport which has the issue */
type: string;
/** Base64-encoded element hash */
element_hash: string;
/** Error message */
message: string;
/** Error source, must be unspecified */
source: "unspecified";
/** Type of element of the user's Telegram Passport which has the issue */
type: string;
/** Base64-encoded element hash */
element_hash: string;
/** Error message */
message: string;
}

@@ -1,109 +0,101 @@

import { User } from "./manage";
import type { User } from "./manage.js";
/** This object represents a portion of the price for goods or services. */
export interface LabeledPrice {
/** Portion label */
label: string;
/** Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
amount: number;
/** Portion label */
label: string;
/** Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
amount: number;
}
/** This object contains basic information about an invoice. */
export interface Invoice {
/** Product name */
title: string;
/** Product description */
description: string;
/** Unique bot deep-linking parameter that can be used to generate this invoice */
start_parameter: string;
/** Three-letter ISO 4217 currency code */
currency: string;
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
total_amount: number;
/** Product name */
title: string;
/** Product description */
description: string;
/** Unique bot deep-linking parameter that can be used to generate this invoice */
start_parameter: string;
/** Three-letter ISO 4217 currency code */
currency: string;
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
total_amount: number;
}
/** This object represents a shipping address. */
export interface ShippingAddress {
/** Two-letter ISO 3166-1 alpha-2 country code */
country_code: string;
/** State, if applicable */
state: string;
/** City */
city: string;
/** First line for the address */
street_line1: string;
/** Second line for the address */
street_line2: string;
/** Address post code */
post_code: string;
/** Two-letter ISO 3166-1 alpha-2 country code */
country_code: string;
/** State, if applicable */
state: string;
/** City */
city: string;
/** First line for the address */
street_line1: string;
/** Second line for the address */
street_line2: string;
/** Address post code */
post_code: string;
}
/** This object represents information about an order. */
export interface OrderInfo {
/** User name */
name?: string;
/** User's phone number */
phone_number?: string;
/** User email */
email?: string;
/** User shipping address */
shipping_address?: ShippingAddress;
/** User name */
name?: string;
/** User's phone number */
phone_number?: string;
/** User email */
email?: string;
/** User shipping address */
shipping_address?: ShippingAddress;
}
/** This object represents one shipping option. */
export interface ShippingOption {
/** Shipping option identifier */
id: string;
/** Option title */
title: string;
/** List of price portions */
prices: LabeledPrice[];
/** Shipping option identifier */
id: string;
/** Option title */
title: string;
/** List of price portions */
prices: LabeledPrice[];
}
/** This object contains basic information about a successful payment. */
export interface SuccessfulPayment {
/** Three-letter ISO 4217 currency code */
currency: string;
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
total_amount: number;
/** Bot specified invoice payload */
invoice_payload: string;
/** Identifier of the shipping option chosen by the user */
shipping_option_id?: string;
/** Order information provided by the user */
order_info?: OrderInfo;
/** Telegram payment identifier */
telegram_payment_charge_id: string;
/** Provider payment identifier */
provider_payment_charge_id: string;
/** Three-letter ISO 4217 currency code */
currency: string;
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
total_amount: number;
/** Bot specified invoice payload */
invoice_payload: string;
/** Identifier of the shipping option chosen by the user */
shipping_option_id?: string;
/** Order information provided by the user */
order_info?: OrderInfo;
/** Telegram payment identifier */
telegram_payment_charge_id: string;
/** Provider payment identifier */
provider_payment_charge_id: string;
}
/** This object contains information about an incoming shipping query. */
export interface ShippingQuery {
/** Unique query identifier */
id: string;
/** User who sent the query */
from: User;
/** Bot specified invoice payload */
invoice_payload: string;
/** User specified shipping address */
shipping_address: ShippingAddress;
/** Unique query identifier */
id: string;
/** User who sent the query */
from: User;
/** Bot specified invoice payload */
invoice_payload: string;
/** User specified shipping address */
shipping_address: ShippingAddress;
}
/** This object contains information about an incoming pre-checkout query. */
export interface PreCheckoutQuery {
/** Unique query identifier */
id: string;
/** User who sent the query */
from: User;
/** Three-letter ISO 4217 currency code */
currency: string;
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
total_amount: number;
/** Bot specified invoice payload */
invoice_payload: string;
/** Identifier of the shipping option chosen by the user */
shipping_option_id?: string;
/** Order information provided by the user */
order_info?: OrderInfo;
/** Unique query identifier */
id: string;
/** User who sent the query */
from: User;
/** Three-letter ISO 4217 currency code */
currency: string;
/** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
total_amount: number;
/** Bot specified invoice payload */
invoice_payload: string;
/** Identifier of the shipping option chosen by the user */
shipping_option_id?: string;
/** Order information provided by the user */
order_info?: OrderInfo;
}

@@ -74,4 +74,5 @@ # Telegram Bot API types for grammY

Instead, grammY specifies its own version of what an `InputFile` is, hence automatically adjusting `@grammyjs/types` with a custom `InputFile` type used throughout all affected methods and interfaces.
This is possible by what we call a _proxy type_.
grammY then imports the proxy type called `InputProxyType` and parametrises it with its version of `InputFile`.
This is possible by adding a type parameter to all affected types.
grammY then import types parametrises these types with its version of `InputFile`, and re-exports the adjusted types.
This is why you should always import Bot API as described here: <https://grammy.dev/guide/api.html#type-definitions-for-the-api>.

@@ -95,1 +96,13 @@ ## Differences to the Bot API

Documentation strings containing an image are adjusted to make sense without the images, too.
## Contributing
This is a Deno project.
All the files are TypeScript files that are published on <https://deno.land/x/grammy_types>.
This project uses [deno2node](https://github.com/fromdeno/deno2node) to emit declaration files which are then published on npm.
If you want to work on this, you do not need to have Node.js installed.
You also should not run `npm install`.
You only need [Deno](https://deno.land) and the VSCode extensions recommended in this repo.
Run `deno task` to see available development scripts.

@@ -1,58 +0,56 @@

import { CallbackQuery } from "./markup";
import { ChosenInlineResult, InlineQuery } from "./inline";
import { Chat, ChatJoinRequest, ChatMemberUpdated, User } from "./manage";
import { Message, Poll, PollAnswer } from "./message";
import { PreCheckoutQuery, ShippingQuery } from "./payment";
import type { CallbackQuery } from "./markup.js";
import type { ChosenInlineResult, InlineQuery } from "./inline.js";
import type { Chat, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js";
import type { Message, Poll, PollAnswer } from "./message.js";
import type { PreCheckoutQuery, ShippingQuery } from "./payment.js";
/** Internal namespace used to make some message types more accurate */
export namespace Update {
/** Internal type holding properties that message updates in channels share. */
export interface Channel {
chat: Chat.ChannelChat;
}
/** Internal type holding properties that message updates outside of channels share. */
export interface NonChannel {
chat: Exclude<Chat, Chat.ChannelChat>;
from: User;
}
/** Internal type holding properties that updates about edited messages share. */
export interface Edited {
/** Date the message was last edited in Unix time */
edit_date: number;
}
export declare namespace Update {
/** Internal type holding properties that message updates in channels share. */
interface Channel {
chat: Chat.ChannelChat;
}
/** Internal type holding properties that message updates outside of channels share. */
interface NonChannel {
chat: Exclude<Chat, Chat.ChannelChat>;
from: User;
}
/** Internal type holding properties that updates about edited messages share. */
interface Edited {
/** Date the message was last edited in Unix time */
edit_date: number;
}
}
/** This object represents an incoming update.
At most one of the optional parameters can be present in any given update. */
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. */
update_id: number;
/** New incoming message of any kind - text, photo, sticker, etc. */
message?: Message & Update.NonChannel;
/** New version of a message that is known to the bot and was edited */
edited_message?: Message & Update.Edited & Update.NonChannel;
/** New incoming channel post of any kind - text, photo, sticker, etc. */
channel_post?: Message & Update.Channel;
/** New version of a channel post that is known to the bot and was edited */
edited_channel_post?: Message & Update.Edited & Update.Channel;
/** New incoming inline query */
inline_query?: InlineQuery;
/** The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. */
chosen_inline_result?: ChosenInlineResult;
/** New incoming callback query */
callback_query?: CallbackQuery;
/** New incoming shipping query. Only for invoices with flexible price */
shipping_query?: ShippingQuery;
/** New incoming pre-checkout query. Contains full information about checkout */
pre_checkout_query?: PreCheckoutQuery;
/** New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot */
poll?: Poll;
/** A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself. */
poll_answer?: PollAnswer;
/** The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user. */
my_chat_member?: ChatMemberUpdated;
/** A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates. */
chat_member?: ChatMemberUpdated;
/** A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates. */
chat_join_request?: ChatJoinRequest;
/** 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. */
message?: Message & Update.NonChannel;
/** New version of a message that is known to the bot and was edited */
edited_message?: Message & Update.Edited & Update.NonChannel;
/** New incoming channel post of any kind - text, photo, sticker, etc. */
channel_post?: Message & Update.Channel;
/** New version of a channel post that is known to the bot and was edited */
edited_channel_post?: Message & Update.Edited & Update.Channel;
/** New incoming inline query */
inline_query?: InlineQuery;
/** The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. */
chosen_inline_result?: ChosenInlineResult;
/** New incoming callback query */
callback_query?: CallbackQuery;
/** New incoming shipping query. Only for invoices with flexible price */
shipping_query?: ShippingQuery;
/** New incoming pre-checkout query. Contains full information about checkout */
pre_checkout_query?: PreCheckoutQuery;
/** New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot */
poll?: Poll;
/** A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself. */
poll_answer?: PollAnswer;
/** The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user. */
my_chat_member?: ChatMemberUpdated;
/** A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates. */
chat_member?: ChatMemberUpdated;
/** A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates. */
chat_join_request?: ChatJoinRequest;
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc