@grammyjs/types 2.3.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/inline.d.ts +2 -2
- package/manage.d.ts +4 -0
- package/message.d.ts +6 -2
- package/package.json +1 -1
- package/proxied.d.ts +24 -0
package/inline.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export namespace InlineKeyboardButton {
|
|
|
30
30
|
text: string;
|
|
31
31
|
}
|
|
32
32
|
export interface UrlButton extends AbstractInlineKeyboardButton {
|
|
33
|
-
/** HTTP or tg:// url to be opened when button is pressed */
|
|
33
|
+
/** 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. */
|
|
34
34
|
url: string;
|
|
35
35
|
}
|
|
36
36
|
export interface LoginButton extends AbstractInlineKeyboardButton {
|
|
@@ -63,7 +63,7 @@ export namespace InlineKeyboardButton {
|
|
|
63
63
|
export interface PayButton extends AbstractInlineKeyboardButton {
|
|
64
64
|
/** Specify True, to send a Pay button.
|
|
65
65
|
|
|
66
|
-
NOTE: This type of button must always be the first button in the first row. */
|
|
66
|
+
NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
|
|
67
67
|
pay: boolean;
|
|
68
68
|
}
|
|
69
69
|
}
|
package/manage.d.ts
CHANGED
|
@@ -103,6 +103,8 @@ export namespace Chat {
|
|
|
103
103
|
pinned_message?: Message;
|
|
104
104
|
/** The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. */
|
|
105
105
|
message_auto_delete_time?: number;
|
|
106
|
+
/** True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. */
|
|
107
|
+
has_protected_content?: true;
|
|
106
108
|
}
|
|
107
109
|
/** Internal type holding properties that those group, supergroup, and channel chats returned from `getChat` share. */
|
|
108
110
|
interface NonPrivateGetChat extends GetChat {
|
|
@@ -129,6 +131,8 @@ export namespace Chat {
|
|
|
129
131
|
export interface PrivateGetChat extends PrivateChat, GetChat {
|
|
130
132
|
/** Bio of the other party in a private chat. Returned only in getChat. */
|
|
131
133
|
bio?: string;
|
|
134
|
+
/** 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. */
|
|
135
|
+
has_private_forwards?: true;
|
|
132
136
|
}
|
|
133
137
|
/** Internal type representing group chats returned from `getChat`. */
|
|
134
138
|
export interface GroupGetChat extends GroupChat, MultiUserGetChat {}
|
package/message.d.ts
CHANGED
|
@@ -31,12 +31,16 @@ export namespace Message {
|
|
|
31
31
|
forward_sender_name?: string;
|
|
32
32
|
/** For forwarded messages, date the original message was sent in Unix time */
|
|
33
33
|
forward_date?: number;
|
|
34
|
+
/** True, if the message is a channel post that was automatically forwarded to the connected discussion group */
|
|
35
|
+
is_automatic_forward?: true;
|
|
34
36
|
/** 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. */
|
|
35
37
|
reply_to_message?: ReplyMessage;
|
|
36
38
|
/** Bot through which the message was sent */
|
|
37
39
|
via_bot?: User;
|
|
38
40
|
/** Date the message was last edited in Unix time */
|
|
39
41
|
edit_date?: number;
|
|
42
|
+
/** True, if the message can't be forwarded */
|
|
43
|
+
has_protected_content?: true;
|
|
40
44
|
/** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
|
|
41
45
|
author_signature?: string;
|
|
42
46
|
/** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
|
|
@@ -219,8 +223,8 @@ Message entities can be nested, providing following restrictions are met:
|
|
|
219
223
|
|
|
220
224
|
Links `tg://user?id=<user_id>` can be used to mention a user by their ID without using a username. Please note:
|
|
221
225
|
|
|
222
|
-
- These links will work only if they are used inside an inline link. For example, they will not work, when used in
|
|
223
|
-
- 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 inline button or is a member in the group where he was mentioned.
|
|
226
|
+
- 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.
|
|
227
|
+
- 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.
|
|
224
228
|
|
|
225
229
|
#### MarkdownV2 style
|
|
226
230
|
To use this mode, pass *MarkdownV2* in the *parse_mode* field. Use the following syntax in your message:
|
package/package.json
CHANGED
package/proxied.d.ts
CHANGED
|
@@ -620,6 +620,7 @@ export interface InputFileProxy<F> {
|
|
|
620
620
|
| "record_voice"
|
|
621
621
|
| "upload_voice"
|
|
622
622
|
| "upload_document"
|
|
623
|
+
| "choose_sticker"
|
|
623
624
|
| "find_location"
|
|
624
625
|
| "record_video_note"
|
|
625
626
|
| "upload_video_note";
|
|
@@ -721,6 +722,29 @@ export interface InputFileProxy<F> {
|
|
|
721
722
|
custom_title: string;
|
|
722
723
|
}): true;
|
|
723
724
|
|
|
725
|
+
/**
|
|
726
|
+
* Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat:
|
|
727
|
+
*
|
|
728
|
+
* - Won't be able to send messages on behalf of any of their channels.
|
|
729
|
+
* - Won't be able to join live streams on behalf of the banned chat.
|
|
730
|
+
*
|
|
731
|
+
* The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
|
|
732
|
+
*/
|
|
733
|
+
banChatSenderChat(args: {
|
|
734
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
735
|
+
chat_id: number | string;
|
|
736
|
+
/** Unique identifier of the target sender chat */
|
|
737
|
+
sender_chat_id: number;
|
|
738
|
+
}): true;
|
|
739
|
+
|
|
740
|
+
/** Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success. */
|
|
741
|
+
unbanChatSenderChat(args: {
|
|
742
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
743
|
+
chat_id: number | string;
|
|
744
|
+
/** Unique identifier of the target sender chat */
|
|
745
|
+
sender_chat_id: number;
|
|
746
|
+
}): true;
|
|
747
|
+
|
|
724
748
|
/** Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success. */
|
|
725
749
|
setChatPermissions(args: {
|
|
726
750
|
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|