@grammyjs/types
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -14,11 +14,11 @@ import type { Location, Message, PhotoSize } from "./message.js"; | ||
/** Unix time for the most recent error that happened when trying to deliver an update via webhook */ | ||
last_error_date: number; | ||
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; | ||
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; | ||
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">>; | ||
allowed_updates?: Array<Exclude<keyof Update, "update_id">>; | ||
} | ||
@@ -74,3 +74,3 @@ /** This object represents a Telegram user or bot. */ | ||
/** Internal type representing private chats. */ | ||
export interface PrivateChat extends AbstractChat, UserNameChat { | ||
interface PrivateChat extends AbstractChat, UserNameChat { | ||
type: "private"; | ||
@@ -83,7 +83,7 @@ /** First name of the other party in a private chat */ | ||
/** Internal type representing group chats. */ | ||
export interface GroupChat extends AbstractChat, TitleChat { | ||
interface GroupChat extends AbstractChat, TitleChat { | ||
type: "group"; | ||
} | ||
/** Internal type representing super group chats. */ | ||
export interface SupergroupChat extends AbstractChat, UserNameChat, TitleChat { | ||
interface SupergroupChat extends AbstractChat, UserNameChat, TitleChat { | ||
type: "supergroup"; | ||
@@ -94,3 +94,3 @@ /** True, if the supergroup chat is a forum (has topics enabled) */ | ||
/** Internal type representing channel chats. */ | ||
export interface ChannelChat extends AbstractChat, UserNameChat, TitleChat { | ||
interface ChannelChat extends AbstractChat, UserNameChat, TitleChat { | ||
type: "channel"; | ||
@@ -134,3 +134,3 @@ } | ||
/** Internal type representing private chats returned from `getChat`. */ | ||
export interface PrivateGetChat extends PrivateChat, NonGroupGetChat, 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. */ | ||
@@ -146,6 +146,6 @@ emoji_status_custom_emoji_id?: string; | ||
/** Internal type representing group chats returned from `getChat`. */ | ||
export interface GroupGetChat extends GroupChat, MultiUserGetChat { | ||
interface GroupGetChat extends GroupChat, MultiUserGetChat { | ||
} | ||
/** Internal type representing supergroup chats returned from `getChat`. */ | ||
export interface SupergroupGetChat extends SupergroupChat, NonGroupGetChat, MultiUserGetChat, LargeGetChat { | ||
interface SupergroupGetChat extends SupergroupChat, NonGroupGetChat, MultiUserGetChat, LargeGetChat { | ||
/** True, if users need to join the supergroup before they can send messages. Returned only in getChat. */ | ||
@@ -165,5 +165,4 @@ join_to_send_messages?: true; | ||
/** Internal type representing channel chats returned from `getChat`. */ | ||
export interface ChannelGetChat extends ChannelChat, NonGroupGetChat, LargeGetChat { | ||
interface ChannelGetChat extends ChannelChat, NonGroupGetChat, LargeGetChat { | ||
} | ||
export {}; | ||
} | ||
@@ -170,0 +169,0 @@ /** This object represents a chat. */ |
@@ -13,19 +13,19 @@ import type { ChatAdministratorRights, User } from "./manage.js"; | ||
} | ||
export interface UrlButton extends AbstractInlineKeyboardButton { | ||
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 { | ||
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 { | ||
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 { | ||
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 { | ||
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. | ||
@@ -36,3 +36,3 @@ | ||
} | ||
export interface SwitchInlineCurrentChatButton extends AbstractInlineKeyboardButton { | ||
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. | ||
@@ -43,7 +43,7 @@ | ||
} | ||
export interface SwitchInlineChosenChatButton extends AbstractInlineKeyboardButton { | ||
interface SwitchInlineChosenChatButton extends AbstractInlineKeyboardButton { | ||
/** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field */ | ||
switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat; | ||
} | ||
export interface GameButton extends AbstractInlineKeyboardButton { | ||
interface GameButton extends AbstractInlineKeyboardButton { | ||
/** Description of the game that will be launched when the user presses the button. | ||
@@ -54,3 +54,3 @@ | ||
} | ||
export interface PayButton extends AbstractInlineKeyboardButton { | ||
interface PayButton extends AbstractInlineKeyboardButton { | ||
/** Specify True, to send a Pay button. | ||
@@ -61,3 +61,2 @@ | ||
} | ||
export {}; | ||
} | ||
@@ -64,0 +63,0 @@ /** This object represents one button of an inline keyboard. You must use exactly one of the optional fields. */ |
110
message.d.ts
@@ -23,3 +23,3 @@ import type { Chat, File, User } from "./manage.js"; | ||
} | ||
export interface CommonMessage extends ServiceMessage { | ||
interface CommonMessage extends ServiceMessage { | ||
/** For forwarded messages, sender of the original message */ | ||
@@ -52,3 +52,3 @@ forward_from?: User; | ||
} | ||
export interface CaptionableMessage extends CommonMessage { | ||
interface CaptionableMessage extends CommonMessage { | ||
/** Caption for the animation, audio, document, photo, video or voice */ | ||
@@ -59,3 +59,3 @@ caption?: string; | ||
} | ||
export interface MediaMessage extends CaptionableMessage { | ||
interface MediaMessage extends CaptionableMessage { | ||
/** The unique identifier of a media message group this message belongs to */ | ||
@@ -66,49 +66,48 @@ media_group_id?: string; | ||
} | ||
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 TextMessage = CommonMessage & MsgWith<"text">; | ||
type AudioMessage = CaptionableMessage & MsgWith<"audio">; | ||
type DocumentMessage = CaptionableMessage & MsgWith<"document">; | ||
type AnimationMessage = DocumentMessage & MsgWith<"animation">; | ||
type PhotoMessage = MediaMessage & MsgWith<"photo">; | ||
type StickerMessage = CommonMessage & MsgWith<"sticker">; | ||
type VideoMessage = MediaMessage & MsgWith<"video">; | ||
type VideoNoteMessage = CommonMessage & MsgWith<"video_note">; | ||
type VoiceMessage = CaptionableMessage & MsgWith<"voice">; | ||
type ContactMessage = CommonMessage & MsgWith<"contact">; | ||
type DiceMessage = CommonMessage & MsgWith<"dice">; | ||
type GameMessage = CommonMessage & MsgWith<"game">; | ||
type PollMessage = CommonMessage & MsgWith<"poll">; | ||
type LocationMessage = CommonMessage & MsgWith<"location">; | ||
type VenueMessage = LocationMessage & MsgWith<"venue">; | ||
type NewChatMembersMessage = ServiceMessage & MsgWith<"new_chat_members">; | ||
type LeftChatMemberMessage = ServiceMessage & MsgWith<"left_chat_member">; | ||
type NewChatTitleMessage = ServiceMessage & MsgWith<"new_chat_title">; | ||
type NewChatPhotoMessage = ServiceMessage & MsgWith<"new_chat_photo">; | ||
type DeleteChatPhotoMessage = ServiceMessage & MsgWith<"delete_chat_photo">; | ||
type GroupChatCreatedMessage = ServiceMessage & MsgWith<"group_chat_created">; | ||
type SupergroupChatCreated = ServiceMessage & MsgWith<"supergroup_chat_created">; | ||
type ChannelChatCreatedMessage = ServiceMessage & MsgWith<"channel_chat_created">; | ||
type MessageAutoDeleteTimerChangedMessage = ServiceMessage & MsgWith<"message_auto_delete_timer_changed">; | ||
type MigrateToChatIdMessage = ServiceMessage & MsgWith<"migrate_to_chat_id">; | ||
type MigrateFromChatIdMessage = ServiceMessage & MsgWith<"migrate_from_chat_id">; | ||
type PinnedMessageMessage = ServiceMessage & MsgWith<"pinned_message">; | ||
type InvoiceMessage = ServiceMessage & MsgWith<"invoice">; | ||
type SuccessfulPaymentMessage = ServiceMessage & MsgWith<"successful_payment">; | ||
type UserSharedMessage = ServiceMessage & MsgWith<"user_shared">; | ||
type ChatSharedMessage = ServiceMessage & MsgWith<"chat_shared">; | ||
type ConnectedWebsiteMessage = ServiceMessage & MsgWith<"connected_website">; | ||
type WriteAccessAllowedMessage = ServiceMessage & MsgWith<"write_access_allowed">; | ||
type PassportDataMessage = ServiceMessage & MsgWith<"passport_data">; | ||
type ProximityAlertTriggeredMessage = ServiceMessage & MsgWith<"proximity_alert_triggered">; | ||
type ForumTopicCreatedMessage = ServiceMessage & MsgWith<"forum_topic_created">; | ||
type ForumTopicEditedMessage = ServiceMessage & MsgWith<"forum_topic_edited">; | ||
type ForumTopicClosedMessage = ServiceMessage & MsgWith<"forum_topic_closed">; | ||
type ForumTopicReopenedMessage = ServiceMessage & MsgWith<"forum_topic_reopened">; | ||
type GeneralForumTopicHiddenMessage = ServiceMessage & MsgWith<"general_forum_topic_hidden">; | ||
type GeneralForumTopicUnhiddenMessage = ServiceMessage & MsgWith<"general_forum_topic_unhidden">; | ||
type VideoChatScheduledMessage = ServiceMessage & MsgWith<"video_chat_scheduled">; | ||
type VideoChatStartedMessage = ServiceMessage & MsgWith<"video_chat_started">; | ||
type VideoChatEndedMessage = ServiceMessage & MsgWith<"video_chat_ended">; | ||
type VideoChatParticipantsInvitedMessage = ServiceMessage & MsgWith<"video_chat_participants_invited">; | ||
type WebAppDataMessage = ServiceMessage & MsgWith<"web_app_data">; | ||
} | ||
@@ -329,6 +328,6 @@ type ReplyMessage = Message & { | ||
} | ||
export interface CommonMessageEntity extends AbstractMessageEntity { | ||
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 { | ||
interface PreMessageEntity extends AbstractMessageEntity { | ||
type: "pre"; | ||
@@ -338,3 +337,3 @@ /** For “pre” only, the programming language of the entity text */ | ||
} | ||
export interface TextLinkMessageEntity extends AbstractMessageEntity { | ||
interface TextLinkMessageEntity extends AbstractMessageEntity { | ||
type: "text_link"; | ||
@@ -344,3 +343,3 @@ /** For “text_link” only, URL that will be opened after user taps on the text */ | ||
} | ||
export interface TextMentionMessageEntity extends AbstractMessageEntity { | ||
interface TextMentionMessageEntity extends AbstractMessageEntity { | ||
type: "text_mention"; | ||
@@ -350,3 +349,3 @@ /** For “text_mention” only, the mentioned user */ | ||
} | ||
export interface CustomEmojiMessageEntity extends AbstractMessageEntity { | ||
interface CustomEmojiMessageEntity extends AbstractMessageEntity { | ||
type: "custom_emoji"; | ||
@@ -356,3 +355,2 @@ /** For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker */ | ||
} | ||
export {}; | ||
} | ||
@@ -359,0 +357,0 @@ /** This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. */ |
{ | ||
"name": "@grammyjs/types", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"description": "Telegram Bot API type declarations for grammY", | ||
@@ -5,0 +5,0 @@ "main": "mod.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
280306
4121