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 3.3.1 to 3.4.0

2

api.d.ts

@@ -18,3 +18,3 @@ export interface ApiError {

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. */
/** The group has been migrated to a supergroup with the specified identifier. */
migrate_to_chat_id?: number;

@@ -21,0 +21,0 @@ /** In case of exceeding flood control, the number of seconds left to wait before the request can be repeated */

import type { Chat, User } from "./manage.js";
import type { InlineKeyboardMarkup, WebAppInfo } from "./markup.js";
import type { Location, MessageEntity, ParseMode } from "./message.js";
import type { LinkPreviewOptions, Location, MessageEntity, ParseMode } from "./message.js";
import type { LabeledPrice } from "./payment.js";

@@ -576,4 +576,4 @@ /** This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. */

entities?: MessageEntity[];
/** Disables link previews for links in the sent message */
disable_web_page_preview?: boolean;
/** Link preview generation options for the message */
link_preview_options?: LinkPreviewOptions;
}

@@ -580,0 +580,0 @@ /** Represents the content of a location message to be sent as the result of an inline query. */

@@ -1,2 +0,2 @@

import type { Location, Message, PhotoSize } from "./message.js";
import type { Location, Message, PhotoSize, ReactionType } from "./message.js";
import type { Update } from "./update.js";

@@ -26,3 +26,3 @@ /** Describes the current status of a webhook. */

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. */
/** Unique identifier for this user or bot. */
id: number;

@@ -58,3 +58,3 @@ /** True, if this user is a bot */

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. */
/** Unique identifier for this chat. */
id: number;

@@ -108,3 +108,3 @@ /** Type of chat, can be either โ€œprivateโ€, โ€œgroupโ€, โ€œsupergroupโ€ or โ€œchannelโ€ */

/** Internal type holding properties that those private, supergroup, and channel chats returned from `getChat` share. */
interface NonGroupGetChat extends GetChat {
interface NonGroupGetChat {
/** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat. */

@@ -114,3 +114,3 @@ active_usernames?: string[];

/** Internal type holding properties that those group, supergroup, and channel chats returned from `getChat` share. */
interface NonPrivateGetChat extends GetChat {
interface NonPrivateGetChat {
/** Description, for groups, supergroups and channel chats. Returned only in getChat. */

@@ -120,5 +120,7 @@ description?: string;

invite_link?: string;
/** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat. */
available_reactions?: ReactionType[];
}
/** Internal type holding properties that those group and supergroup chats returned from `getChat` share. */
interface MultiUserGetChat extends NonPrivateGetChat {
interface MultiUserGetChat {
/** Default chat member permissions, for groups and supergroups. Returned only in getChat. */

@@ -129,13 +131,20 @@ permissions?: ChatPermissions;

}
/** Internal type holding properties that those private and channel chats returned from `getChat` share. */
interface NonMultiUserGetChat {
/** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. */
accent_color_id: number;
/** Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat. */
background_custom_emoji_id?: string;
/** Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat. */
emoji_status_custom_emoji_id?: string;
/** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat. */
emoji_status_expiration_date?: number;
}
/** 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. */
interface LargeGetChat {
/** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. Returned only in getChat. */
linked_chat_id?: number;
}
/** Internal type representing private chats returned from `getChat`. */
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;
/** Expiration date of the emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat. */
emoji_status_expiration_date?: number;
interface PrivateGetChat extends PrivateChat, GetChat, NonGroupGetChat, NonMultiUserGetChat {
/** Bio of the other party in a private chat. Returned only in getChat. */

@@ -149,6 +158,6 @@ bio?: string;

/** Internal type representing group chats returned from `getChat`. */
interface GroupGetChat extends GroupChat, MultiUserGetChat {
interface GroupGetChat extends GroupChat, GetChat, NonPrivateGetChat, MultiUserGetChat {
}
/** Internal type representing supergroup chats returned from `getChat`. */
interface SupergroupGetChat extends SupergroupChat, NonGroupGetChat, MultiUserGetChat, LargeGetChat {
interface SupergroupGetChat extends SupergroupChat, GetChat, NonGroupGetChat, NonPrivateGetChat, MultiUserGetChat, LargeGetChat {
/** True, if users need to join the supergroup before they can send messages. Returned only in getChat. */

@@ -160,2 +169,4 @@ join_to_send_messages?: true;

slow_mode_delay?: number;
/** True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat. */
has_visible_history?: boolean;
/** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat. */

@@ -169,3 +180,7 @@ has_aggressive_anti_spam_enabled?: true;

/** Internal type representing channel chats returned from `getChat`. */
interface ChannelGetChat extends ChannelChat, NonGroupGetChat, LargeGetChat {
interface ChannelGetChat extends ChannelChat, GetChat, NonGroupGetChat, NonPrivateGetChat, NonMultiUserGetChat, LargeGetChat {
/** Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat. */
profile_accent_color_id?: number;
/** Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat. */
profile_background_custom_emoji_id?: string;
}

@@ -249,2 +264,19 @@ }

}
/** 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;
/** True, if the user joined the chat via a chat folder invite link */
via_chat_folder_invite_link?: boolean;
}
/** This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:

@@ -325,3 +357,3 @@ - ChatMemberOwner

is_member: boolean;
/** True, if the user is allowed to send text messages, contacts, invoices, locations and venues */
/** True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues */
can_send_messages: boolean;

@@ -373,19 +405,2 @@ /** True, if the user is allowed to send audios */

}
/** 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;
/** True, if the user joined the chat via a chat folder invite link */
via_chat_folder_invite_link?: boolean;
}
/** Represents a join request sent to a chat. */

@@ -397,3 +412,3 @@ export interface ChatJoinRequest {

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 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. */
/** Identifier of a private chat with the user who sent the join request. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. */
user_chat_id: number;

@@ -409,3 +424,3 @@ /** Date the request was sent in Unix time */

export interface ChatPermissions {
/** True, if the user is allowed to send text messages, contacts, invoices, locations and venues */
/** True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues */
can_send_messages?: boolean;

@@ -464,12 +479,62 @@ /** True, if the user is allowed to send audios */

}
/** 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;
/** This object describes the source of a chat boost. It can be one of
- ChatBoostSourcePremium
- ChatBoostSourceGiftCode
- ChatBoostSourceGiveaway */
export type ChatBoostSource = ChatBoostSourcePremium | ChatBoostSourceGiftCode | ChatBoostSourceGiveaway;
/** The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user. */
export interface ChatBoostSourcePremium {
/** Source of the boost, always โ€œpremiumโ€ */
source: "premium";
/** User that boosted the chat */
user: User;
}
/** The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. */
export interface ChatBoostSourceGiftCode {
/** Source of the boost, always โ€œgift_codeโ€ */
source: "gift_code";
/** User for which the gift code was created */
user: User;
}
/** The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. */
export interface ChatBoostSourceGiveaway {
/** Source of the boost, always โ€œgiveawayโ€ */
source: "giveaway";
/** Identifier of a message in the chat with the giveaway; the message could have been deleted already */
giveaway_message_id: number;
}
/** This object contains information about a chat boost. */
export interface ChatBoost {
/** Unique identifier of the boost */
boost_id: string;
/** Point in time (Unix timestamp) when the chat was boosted */
add_date: number;
/** Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged */
expiration_date: number;
/** Source of the added boost */
source: ChatBoostSource;
}
/** This object represents a boost added to a chat or changed. */
export interface ChatBoostUpdated {
/** Chat which was boosted */
chat: Chat;
/** Infomation about the chat boost */
boost: ChatBoost;
}
/** This object represents a boost removed from a chat. */
export interface ChatBoostRemoved {
/** Chat which was boosted */
chat: Chat;
/** Unique identifier of the boost */
boost_id: string;
/** Point in time (Unix timestamp) when the boost was removed */
remove_date: number;
/** Source of the removed boost */
source: ChatBoostSource;
}
/** This object represents a list of boosts added to a chat by a user. */
export interface UserChatBoosts {
/** The list of boosts added to the chat by the user */
boosts: ChatBoost[];
}
import type { ChatAdministratorRights, User } from "./manage.js";
import type { Message } from "./message.js";
import type { MaybeInaccessibleMessage } from "./message.js";
/** This object represents an inline keyboard that appears right next to the message it belongs to. */

@@ -96,4 +96,4 @@ export interface InlineKeyboardMarkup {

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;
/** Message sent by the bot with the callback button that originated the query */
message?: MaybeInaccessibleMessage;
/** Identifier of the message sent via the bot in inline mode, that originated the query. */

@@ -130,5 +130,5 @@ inline_message_id?: 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 RequestUsersButton extends CommonButton {
/** If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a โ€œusers_sharedโ€ service message. Available in private chats only. */
request_users: KeyboardButtonRequestUsers;
}

@@ -156,4 +156,4 @@ interface RequestChatButton extends CommonButton {

}
/** 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;
/** 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_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive. */
export type KeyboardButton = KeyboardButton.CommonButton | KeyboardButton.RequestUsersButton | 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. */

@@ -195,10 +195,12 @@ export interface KeyboardButtonPollType {

}
/** 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, which will be received back in the UserShared object. Must be unique within the message */
/** This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. */
export interface KeyboardButtonRequestUsers {
/** Signed 32-bit identifier of the request that will be received back in the UsersShared 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. */
/** Pass True to request bots, pass False to request regular users. 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. */
/** Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied. */
user_is_premium?: boolean;
/** The maximum number of users to be selected; 1-10. Defaults to 1. */
max_quantity?: boolean;
}

@@ -205,0 +207,0 @@ /** 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. */

@@ -1,2 +0,2 @@

import type { Chat, File, User } from "./manage.js";
import type { Chat, User } from "./manage.js";
import type { InlineKeyboardMarkup } from "./markup.js";

@@ -16,5 +16,5 @@ import type { PassportData } from "./passport.js";

sender_chat?: Chat;
/** Date the message was sent in Unix time */
/** Date the message was sent in Unix time. It is always a positive number, representing a valid date. */
date: number;
/** Conversation the message belongs to */
/** Chat the message belongs to */
chat: Chat;

@@ -25,18 +25,12 @@ /** True, if the message is sent to a forum topic */

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;
/** Information about the original message for forwarded messages */
forward_origin?: MessageOrigin;
/** 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. */
/** For replies in the same chat and message thread, 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;
/** Information about the message that is being replied to, which may come from another chat or forum topic */
external_reply?: ExternalReplyInfo;
/** For replies that quote part of the original message, the quoted part of the message */
quote?: TextQuote;
/** Bot through which the message was sent */

@@ -50,2 +44,4 @@ via_bot?: User;

author_signature?: string;
/** Options used for link preview generation for the message, if it is a text message and link preview options were changed */
link_preview_options?: LinkPreviewOptions;
/** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */

@@ -96,3 +92,3 @@ reply_markup?: InlineKeyboardMarkup;

type SuccessfulPaymentMessage = ServiceMessage & MsgWith<"successful_payment">;
type UserSharedMessage = ServiceMessage & MsgWith<"user_shared">;
type UsersSharedMessage = ServiceMessage & MsgWith<"users_shared">;
type ChatSharedMessage = ServiceMessage & MsgWith<"chat_shared">;

@@ -109,2 +105,6 @@ type ConnectedWebsiteMessage = ServiceMessage & MsgWith<"connected_website">;

type GeneralForumTopicUnhiddenMessage = ServiceMessage & MsgWith<"general_forum_topic_unhidden">;
type GiveawayCreatedMessage = ServiceMessage & MsgWith<"giveaway_created">;
type GiveawayMessage = ServiceMessage & MsgWith<"giveaway">;
type GiveawayWinnersMessage = ServiceMessage & MsgWith<"giveaway_winners">;
type GiveawayCompletedMessage = ServiceMessage & MsgWith<"giveaway_completed">;
type VideoChatScheduledMessage = ServiceMessage & MsgWith<"video_chat_scheduled">;

@@ -172,8 +172,8 @@ type VideoChatStartedMessage = ServiceMessage & MsgWith<"video_chat_started">;

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. */
/** The group has been migrated to a supergroup with the specified 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. */
/** The supergroup has been migrated from a group with the specified 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;
/** Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */
pinned_message?: MaybeInaccessibleMessage;
/** Message is an invoice for a payment, information about the invoice. More about payments ยป */

@@ -183,4 +183,4 @@ invoice?: Invoice;

successful_payment?: SuccessfulPayment;
/** Service message: a user was shared with the bot */
user_shared?: UserShared;
/** Service message: users were shared with the bot */
users_shared?: UsersShared;
/** Service message: a chat was shared with the bot */

@@ -208,2 +208,10 @@ chat_shared?: ChatShared;

general_forum_topic_unhidden?: GeneralForumTopicUnhidden;
/** Service message: a scheduled giveaway was created */
giveaway_created?: GiveawayCreated;
/** The message is a scheduled giveaway message */
giveaway?: Giveaway;
/** A giveaway with public winners was completed */
giveaway_winners?: GiveawayWinners;
/** Service message: a giveaway without public winners was completed */
giveaway_completed?: GiveawayCompleted;
/** Service message: video chat scheduled */

@@ -230,3 +238,16 @@ video_chat_scheduled?: VideoChatScheduled;

}
/** 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.
/** This object describes a message that was deleted or is otherwise inaccessible to the bot. */
export interface InaccessibleMessage extends Omit<Message, "chat" | "message_id" | "date"> {
/** Chat the message belonged to */
chat: Chat;
/** Unique message identifier inside the chat */
message_id: number;
/** Always 0. The field can be used to differentiate regular and inaccessible messages. */
date: 0;
}
/** This object describes a message that can be inaccessible to the bot. It can be one of
- Message
- InaccessibleMessage */
export type MaybeInaccessibleMessage = Message | InaccessibleMessage;
/** The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, spoiler text, block quotations as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can specify text entities directly, or use markdown-style or HTML-style formatting.

@@ -238,2 +259,3 @@ Note that Telegram clients will display an **alert** to the user before opening an inline link ('Open this link?' together with the full URL).

- bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.
- blockquote entities can't be nested.
- All other entities can't contain each other.

@@ -246,2 +268,4 @@

You can find the list of programming and markup languages for which syntax highlighting is supported at [libprisma#supported-languages](https://github.com/TelegramMessenger/libprisma#supported-languages).
#### MarkdownV2 style

@@ -251,3 +275,3 @@ To use this mode, pass *MarkdownV2* in the *parse_mode* field. Use the following syntax in your message:

```
*bold \*text*
*bold \*text*
_italic \*text_

@@ -268,2 +292,5 @@ __underline__

`โ€‹`โ€‹`
>Block quotation started
>Block quotation continued
>The last line of the block quotation
```

@@ -296,2 +323,3 @@ Please note:

<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
<blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>
```

@@ -313,3 +341,3 @@ Please note:

```
*bold text*
*bold text*
_italic text_

@@ -329,3 +357,3 @@ [inline URL](http://www.example.com/)

- Entities must not be nested, use parse mode MarkdownV2 instead.
- There is no way to specify underline and strikethrough entities, use parse mode MarkdownV2 instead.
- There is no way to specify โ€œunderlineโ€, โ€œstrikethroughโ€, โ€œspoilerโ€, โ€œblockquoteโ€ and โ€œcustom_emojiโ€ entities, use parse mode MarkdownV2 instead.
- To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.

@@ -336,3 +364,3 @@ - Escaping inside entities is not allowed, so entity must be closed first and reopened again: use `_snake_\__case_` for italic `snake_case` and `*2*\**2=4*` for bold `2*2=4`. */

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 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), โ€œblockquoteโ€ (block quotation), โ€œ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;

@@ -345,3 +373,3 @@ /** Offset in UTF-16 code units to the start of the entity */

interface CommonMessageEntity extends AbstractMessageEntity {
type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "code";
type: "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "blockquote" | "code";
}

@@ -371,2 +399,127 @@ interface PreMessageEntity extends AbstractMessageEntity {

export type MessageEntity = MessageEntity.CommonMessageEntity | MessageEntity.CustomEmojiMessageEntity | MessageEntity.PreMessageEntity | MessageEntity.TextLinkMessageEntity | MessageEntity.TextMentionMessageEntity;
/** This object contains information about the quoted part of a message that is replied to by the given message. */
export interface TextQuote {
/** Text of the quoted part of a message that is replied to by the given message */
text: string;
/** Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes. */
entities?: MessageEntity[];
/** Approximate quote position in the original message in UTF-16 code units as specified by the sender */
position: number;
/** True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. */
is_manual?: true;
}
/** This object contains information about a message that is being replied to, which may come from another chat or forum topic. */
export interface ExternalReplyInfo {
/** Origin of the message replied to by the given message */
origin: MessageOrigin;
/** Chat the original message belongs to. Available only if the chat is a supergroup or a channel. */
chat?: Chat;
/** Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel. */
message_id?: number;
/** Options used for link preview generation for the original message, if it is a text message */
link_preview_options?: LinkPreviewOptions;
/** Message is an animation, information about the animation */
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 forwarded story */
story?: Story;
/** 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;
/** True, if the message media is covered by a spoiler animation */
has_media_spoiler?: true;
/** 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 scheduled giveaway, information about the giveaway */
giveaway?: Giveaway;
/** A giveaway with public winners was completed */
giveaway_winners?: GiveawayWinners;
/** Message is an invoice for a payment, information about the invoice. More about payments ยป */
invoice?: Invoice;
/** Message is a shared location, information about the location */
location?: Location;
/** Message is a native poll, information about the poll */
poll?: Poll;
/** Message is a venue, information about the venue */
venue?: Venue;
}
/** Describes reply parameters for the message that is being sent. */
export interface ReplyParameters {
/** Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified */
message_id: number;
/** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername) */
chat_id?: number | string;
/** Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic. */
allow_sending_without_reply?: boolean;
/** Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message. */
quote?: string;
/** Mode for parsing entities in the quote. See formatting options for more details. */
quote_parse_mode?: string;
/** A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode. */
quote_entities?: MessageEntity[];
/** Position of the quote in the original message in UTF-16 code units */
quote_position?: number;
}
/** This object describes the origin of a message. It can be one of
- MessageOriginUser
- MessageOriginHiddenUser
- MessageOriginChat
- MessageOriginChannel */
export type MessageOrigin = MessageOriginUser | MessageOriginHiddenUser | MessageOriginChat | MessageOriginChannel;
/** The message was originally sent by a known user. */
export interface MessageOriginUser {
/** Type of the message origin, always โ€œuserโ€ */
type: "user";
/** Date the message was sent originally in Unix time */
date: number;
/** User that sent the message originally */
sender_user: User;
}
/** The message was originally sent by an unknown user. */
export interface MessageOriginHiddenUser {
/** Type of the message origin, always โ€œhidden_userโ€ */
type: "hidden_user";
/** Date the message was sent originally in Unix time */
date: number;
/** Name of the user that sent the message originally */
sender_user_name: string;
}
/** The message was originally sent on behalf of a chat to a group chat. */
export interface MessageOriginChat {
/** Type of the message origin, always โ€œchatโ€ */
type: "chat";
/** Date the message was sent originally in Unix time */
date: number;
/** Chat that sent the message originally */
sender_chat: Chat;
/** For messages originally sent by an anonymous chat administrator, original message author signature */
author_signature?: string;
}
/** The message was originally sent to a channel chat. */
export interface MessageOriginChannel {
/** Type of the message origin, always โ€œchannelโ€ */
type: "channel";
/** Date the message was sent originally in Unix time */
date: number;
/** Channel chat to which the message was originally sent */
chat: Chat;
/** Unique message identifier inside the chat */
message_id: number;
/** Signature of the original post author */
author_signature?: string;
}
/** This object represents one size of a photo or a file / sticker thumbnail. */

@@ -499,3 +652,3 @@ export interface PhotoSize {

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. */
/** Contact's user identifier in Telegram. */
user_id?: number;

@@ -636,8 +789,8 @@ /** Additional data about the contact in the form of a vCard */

}
/** This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button. */
export interface UserShared {
/** This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUsers button. */
export interface UsersShared {
/** 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;
/** Identifiers of the shared users. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means. */
user_ids: number[];
}

@@ -648,3 +801,3 @@ /** This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button. */

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. */
/** Identifier of the shared chat. 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;

@@ -679,2 +832,71 @@ }

}
/** This object represents a service message about the creation of a scheduled giveaway. Currently holds no information. */
export interface GiveawayCreated {
}
/** This object represents a message about a scheduled giveaway. */
export interface Giveaway {
/** The list of chats which the user must join to participate in the giveaway */
chats: Chat[];
/** Point in time (Unix timestamp) when winners of the giveaway will be selected */
winners_selection_date: number;
/** The number of users which are supposed to be selected as winners of the giveaway */
winner_count: number;
/** True, if only users who join the chats after the giveaway started should be eligible to win */
only_new_members?: true;
/** True, if the list of giveaway winners will be visible to everyone */
has_public_winners?: true;
/** Description of additional giveaway prize */
prize_description?: string;
/** A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways. */
country_codes?: string[];
/** The number of months the Telegram Premium subscription won from the giveaway will be active for */
premium_subscription_month_count?: number;
}
/** This object represents a message about the completion of a giveaway with public winners. */
export interface GiveawayWinners {
/** The chat that created the giveaway */
chat: Chat;
/** Identifier of the messsage with the giveaway in the chat */
giveaway_message_id: number;
/** Point in time (Unix timestamp) when winners of the giveaway were selected */
winners_selection_date: number;
/** Total number of winners in the giveaway */
winner_count: number;
/** List of up to 100 winners of the giveaway */
winners: User[];
/** The number of other chats the user had to join in order to be eligible for the giveaway */
additional_chat_count?: number;
/** The number of months the Telegram Premium subscription won from the giveaway will be active for */
premium_subscription_month_count?: number;
/** Number of undistributed prizes */
unclaimed_prize_count?: number;
/** True, if only users who had joined the chats after the giveaway started were eligible to win */
only_new_members?: true;
/** True, if the giveaway was canceled because the payment for it was refunded */
was_refunded?: true;
/** Description of additional giveaway prize */
prize_description?: string;
}
/** This object represents a service message about the completion of a giveaway without public winners. */
export interface GiveawayCompleted {
/** Number of winners in the giveaway */
winner_count: number;
/** Number of undistributed prizes */
unclaimed_prize_count?: number;
/** Message with the giveaway that was completed, if it wasn't deleted */
giveaway_message?: Message;
}
/** Describes the options used for link preview generation. */
export interface LinkPreviewOptions {
/** True, if the link preview is disabled */
is_disabled?: boolean;
/** URL to use for the link preview. If empty, then the first URL found in the message text will be used */
url?: string;
/** True, if the media in the link preview is suppposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview */
prefer_small_media?: boolean;
/** True, if the media in the link preview is suppposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview */
prefer_large_media?: boolean;
/** True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text */
show_above_text?: boolean;
}
/** Describes data sent from a Web App to the bot. */

@@ -770,2 +992,64 @@ export interface WebAppData {

}
/** 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;
}
/** This object describes the type of a reaction. Currently, it can be one of */
export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji;
/** The reaction is based on an emoji. */
export interface ReactionTypeEmoji {
/** Type of the reaction, always โ€œemojiโ€ */
type: "emoji";
/** Reaction emoji. Currently, it can be one of "๐Ÿ‘", "๐Ÿ‘Ž", "โค", "๐Ÿ”ฅ", "๐Ÿฅฐ", "๐Ÿ‘", "๐Ÿ˜", "๐Ÿค”", "๐Ÿคฏ", "๐Ÿ˜ฑ", "๐Ÿคฌ", "๐Ÿ˜ข", "๐ŸŽ‰", "๐Ÿคฉ", "๐Ÿคฎ", "๐Ÿ’ฉ", "๐Ÿ™", "๐Ÿ‘Œ", "๐Ÿ•Š", "๐Ÿคก", "๐Ÿฅฑ", "๐Ÿฅด", "๐Ÿ˜", "๐Ÿณ", "โคโ€๐Ÿ”ฅ", "๐ŸŒš", "๐ŸŒญ", "๐Ÿ’ฏ", "๐Ÿคฃ", "โšก", "๐ŸŒ", "๐Ÿ†", "๐Ÿ’”", "๐Ÿคจ", "๐Ÿ˜", "๐Ÿ“", "๐Ÿพ", "๐Ÿ’‹", "๐Ÿ–•", "๐Ÿ˜ˆ", "๐Ÿ˜ด", "๐Ÿ˜ญ", "๐Ÿค“", "๐Ÿ‘ป", "๐Ÿ‘จโ€๐Ÿ’ป", "๐Ÿ‘€", "๐ŸŽƒ", "๐Ÿ™ˆ", "๐Ÿ˜‡", "๐Ÿ˜จ", "๐Ÿค", "โœ", "๐Ÿค—", "๐Ÿซก", "๐ŸŽ…", "๐ŸŽ„", "โ˜ƒ", "๐Ÿ’…", "๐Ÿคช", "๐Ÿ—ฟ", "๐Ÿ†’", "๐Ÿ’˜", "๐Ÿ™‰", "๐Ÿฆ„", "๐Ÿ˜˜", "๐Ÿ’Š", "๐Ÿ™Š", "๐Ÿ˜Ž", "๐Ÿ‘พ", "๐Ÿคทโ€โ™‚", "๐Ÿคท", "๐Ÿคทโ€โ™€", "๐Ÿ˜ก" */
emoji: "๐Ÿ‘" | "๐Ÿ‘Ž" | "โค" | "๐Ÿ”ฅ" | "๐Ÿฅฐ" | "๐Ÿ‘" | "๐Ÿ˜" | "๐Ÿค”" | "๐Ÿคฏ" | "๐Ÿ˜ฑ" | "๐Ÿคฌ" | "๐Ÿ˜ข" | "๐ŸŽ‰" | "๐Ÿคฉ" | "๐Ÿคฎ" | "๐Ÿ’ฉ" | "๐Ÿ™" | "๐Ÿ‘Œ" | "๐Ÿ•Š" | "๐Ÿคก" | "๐Ÿฅฑ" | "๐Ÿฅด" | "๐Ÿ˜" | "๐Ÿณ" | "โคโ€๐Ÿ”ฅ" | "๐ŸŒš" | "๐ŸŒญ" | "๐Ÿ’ฏ" | "๐Ÿคฃ" | "โšก" | "๐ŸŒ" | "๐Ÿ†" | "๐Ÿ’”" | "๐Ÿคจ" | "๐Ÿ˜" | "๐Ÿ“" | "๐Ÿพ" | "๐Ÿ’‹" | "๐Ÿ–•" | "๐Ÿ˜ˆ" | "๐Ÿ˜ด" | "๐Ÿ˜ญ" | "๐Ÿค“" | "๐Ÿ‘ป" | "๐Ÿ‘จโ€๐Ÿ’ป" | "๐Ÿ‘€" | "๐ŸŽƒ" | "๐Ÿ™ˆ" | "๐Ÿ˜‡" | "๐Ÿ˜จ" | "๐Ÿค" | "โœ" | "๐Ÿค—" | "๐Ÿซก" | "๐ŸŽ…" | "๐ŸŽ„" | "โ˜ƒ" | "๐Ÿ’…" | "๐Ÿคช" | "๐Ÿ—ฟ" | "๐Ÿ†’" | "๐Ÿ’˜" | "๐Ÿ™‰" | "๐Ÿฆ„" | "๐Ÿ˜˜" | "๐Ÿ’Š" | "๐Ÿ™Š" | "๐Ÿ˜Ž" | "๐Ÿ‘พ" | "๐Ÿคทโ€โ™‚" | "๐Ÿคท" | "๐Ÿคทโ€โ™€" | "๐Ÿ˜ก";
}
/** The reaction is based on a custom emoji. */
export interface ReactionTypeCustomEmoji {
/** Type of the reaction, always โ€œcustom_emojiโ€ */
type: "custom_emoji";
/** Custom emoji identifier */
custom_emoji: string;
}
/** Represents a reaction added to a message along with the number of times it was added. */
export interface ReactionCount {
/** Type of the reaction */
type: ReactionType;
/** Number of times the reaction was added */
total_count: number;
}
/** This object represents a change of a reaction on a message performed by a user. */
export interface MessageReactionUpdated {
/** The chat containing the message the user reacted to */
chat: Chat;
/** Unique identifier of the message inside the chat */
message_id: number;
/** The user that changed the reaction, if the user isn't anonymous */
user?: User;
/** The chat on behalf of which the reaction was changed, if the user is anonymous */
actor_chat?: Chat;
/** Date of the change in Unix time */
date: number;
/** Previous list of reaction types that were set by the user */
old_reaction: ReactionType[];
/** New list of reaction types that have been set by the user */
new_reaction: ReactionType[];
}
/** This object represents reaction changes on a message with anonymous reactions. */
export interface MessageReactionCountUpdated {
/** The chat containing the message */
chat: Chat;
/** Unique message identifier inside the chat */
message_id: number;
/** Date of the change in Unix time */
date: number;
/** List of reactions that are present on the message */
reactions: ReactionCount[];
}
export {};
{
"name": "@grammyjs/types",
"version": "3.3.1",
"version": "3.4.0",
"description": "Telegram Bot API type declarations for grammY",

@@ -5,0 +5,0 @@ "main": "mod.js",

import type { ChosenInlineResult, InlineQuery } from "./inline.js";
import type { Chat, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js";
import type { Chat, ChatBoostRemoved, ChatBoostUpdated, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js";
import type { CallbackQuery } from "./markup.js";
import type { Message, Poll, PollAnswer } from "./message.js";
import type { Message, MessageReactionCountUpdated, MessageReactionUpdated, Poll, PollAnswer } from "./message.js";
import type { PreCheckoutQuery, ShippingQuery } from "./payment.js";

@@ -36,2 +36,6 @@ /** Internal namespace used to make some message types more accurate */

edited_channel_post?: Message & Update.Edited & Update.Channel;
/** A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots. */
message_reaction?: MessageReactionUpdated;
/** Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. */
message_reaction_count?: MessageReactionCountUpdated;
/** New incoming inline query */

@@ -57,2 +61,6 @@ inline_query?: InlineQuery;

chat_join_request?: ChatJoinRequest;
/** A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates. */
chat_boost?: ChatBoostUpdated;
/** A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. */
removed_chat_boost?: ChatBoostRemoved;
}

Sorry, the diff of this file is too big to display

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