@grammyjs/types
Advanced tools
Comparing version 2.11.2 to 2.12.0
@@ -246,3 +246,3 @@ import { Location, Message, PhotoSize } from "./message"; | ||
can_restrict_members: boolean; | ||
/** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) */ | ||
/** 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; | ||
@@ -308,3 +308,3 @@ /** True, if the user is allowed to change the chat title, photo and other settings */ | ||
can_restrict_members: boolean; | ||
/** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) */ | ||
/** 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; | ||
@@ -343,2 +343,22 @@ /** True, if the user is allowed to change the chat title, photo and other settings */ | ||
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 */ | ||
@@ -352,12 +372,2 @@ can_change_info: boolean; | ||
can_manage_topics: boolean; | ||
/** True, if the user is allowed to send text messages, contacts, locations and venues */ | ||
can_send_messages: boolean; | ||
/** True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes */ | ||
can_send_media_messages: 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; | ||
/** Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever */ | ||
@@ -407,2 +417,4 @@ until_date: number; | ||
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 */ | ||
@@ -418,11 +430,21 @@ date: number; | ||
export interface ChatPermissions { | ||
/** True, if the user is allowed to send text messages, contacts, locations and venues */ | ||
/** 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, documents, photos, videos, video notes and voice notes, implies can_send_messages */ | ||
can_send_media_messages?: boolean; | ||
/** True, if the user is allowed to send polls, implies can_send_messages */ | ||
/** 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, implies can_send_media_messages */ | ||
/** 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, implies can_send_media_messages */ | ||
/** True, if the user is allowed to add web page previews to their messages */ | ||
can_add_web_page_previews?: boolean; | ||
@@ -429,0 +451,0 @@ /** True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */ |
@@ -1,2 +0,2 @@ | ||
import { User } from "./manage"; | ||
import { ChatAdministratorRights, User } from "./manage"; | ||
import { Message } from "./message"; | ||
@@ -130,2 +130,10 @@ | ||
} | ||
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 { | ||
@@ -149,5 +157,7 @@ /** If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. */ | ||
/** This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields web_app, request_contact, request_location, and request_poll are mutually exclusive. */ | ||
/** 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 | ||
@@ -198,1 +208,31 @@ | KeyboardButton.RequestLocationButton | ||
} | ||
/** 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; | ||
} | ||
/** 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; | ||
} |
@@ -115,2 +115,4 @@ import { InlineKeyboardMarkup } from "./markup"; | ||
& MsgWith<"successful_payment">; | ||
export type UserSharedMessage = ServiceMessage & MsgWith<"user_shared">; | ||
export type ChatSharedMessage = ServiceMessage & MsgWith<"chat_shared">; | ||
export type ConnectedWebsiteMessage = | ||
@@ -222,2 +224,6 @@ & ServiceMessage | ||
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 » */ | ||
@@ -279,3 +285,3 @@ connected_website?: string; | ||
- These links will work only if they are used inside an inline link or in an inline keyboard button. For example, they will not work, when used in a message text. | ||
- These mentions are only guaranteed to work if the user has contacted the bot in the past, has sent a callback query to the bot via an inline button or is a member in the group where he was mentioned. | ||
- Unless the user is a member of the chat where they were mentioned, these mentions are only guaranteed to work if the user has contacted the bot in private in the past or has sent a callback query to the bot via an inline button and doesn't have Forwarded Messages privacy enabled for the bot. | ||
@@ -690,2 +696,18 @@ #### MarkdownV2 style | ||
/** 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; | ||
} | ||
/** 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; | ||
} | ||
/** This object represents a service message about a user allowing a bot added to the attachment menu to write messages. Currently holds no information. */ | ||
@@ -692,0 +714,0 @@ export interface WriteAccessAllowed {} |
{ | ||
"name": "@grammyjs/types", | ||
"version": "2.11.2", | ||
"version": "2.12.0", | ||
"description": "Telegram Bot API type declarations for grammY", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
267049
4291