@grammyjs/types 3.12.0 → 3.13.0
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/manage.d.ts +2 -0
- package/message.d.ts +11 -4
- package/methods.d.ts +28 -6
- package/package.json +1 -1
- package/payment.d.ts +3 -0
package/manage.d.ts
CHANGED
|
@@ -654,6 +654,8 @@ export interface ChatMemberMember {
|
|
|
654
654
|
status: "member";
|
|
655
655
|
/** Information about the user */
|
|
656
656
|
user: User;
|
|
657
|
+
/** Date when the user's subscription will expire; Unix time */
|
|
658
|
+
until_date?: number;
|
|
657
659
|
}
|
|
658
660
|
/** Represents a chat member that is under certain restrictions in the chat. Supergroups only. */
|
|
659
661
|
export interface ChatMemberRestricted {
|
package/message.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ export declare namespace Message {
|
|
|
9
9
|
message_id: number;
|
|
10
10
|
/** Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only */
|
|
11
11
|
message_thread_id?: number;
|
|
12
|
-
/** Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats
|
|
12
|
+
/** Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats */
|
|
13
13
|
from?: User;
|
|
14
|
-
/** Sender of the message
|
|
14
|
+
/** Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats. */
|
|
15
15
|
sender_chat?: Chat;
|
|
16
16
|
/** Date the message was sent in Unix time. It is always a positive number, representing a valid date. */
|
|
17
17
|
date: number;
|
|
@@ -129,6 +129,7 @@ export declare namespace Message {
|
|
|
129
129
|
type ReplyMessage = Message & {
|
|
130
130
|
reply_to_message: undefined;
|
|
131
131
|
};
|
|
132
|
+
/** This object represents a message. */
|
|
132
133
|
export interface Message extends Message.MediaMessage {
|
|
133
134
|
/** For text messages, the actual UTF-8 text of the message */
|
|
134
135
|
text?: string;
|
|
@@ -1181,8 +1182,9 @@ export interface File {
|
|
|
1181
1182
|
/** This object describes the type of a reaction. Currently, it can be one of
|
|
1182
1183
|
|
|
1183
1184
|
- ReactionTypeEmoji
|
|
1184
|
-
- ReactionTypeCustomEmoji
|
|
1185
|
-
|
|
1185
|
+
- ReactionTypeCustomEmoji
|
|
1186
|
+
- ReactionTypePaid */
|
|
1187
|
+
export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid;
|
|
1186
1188
|
/** The reaction is based on an emoji. */
|
|
1187
1189
|
export interface ReactionTypeEmoji {
|
|
1188
1190
|
/** Type of the reaction, always “emoji” */
|
|
@@ -1197,6 +1199,11 @@ export interface ReactionTypeCustomEmoji {
|
|
|
1197
1199
|
/** Custom emoji identifier */
|
|
1198
1200
|
custom_emoji_id: string;
|
|
1199
1201
|
}
|
|
1202
|
+
/** The reaction is paid. */
|
|
1203
|
+
export interface ReactionTypePaid {
|
|
1204
|
+
/** Type of the reaction, always “paid” */
|
|
1205
|
+
type: "paid";
|
|
1206
|
+
}
|
|
1200
1207
|
/** Represents a reaction added to a message along with the number of times it was added. */
|
|
1201
1208
|
export interface ReactionCount {
|
|
1202
1209
|
/** Type of the reaction */
|
package/methods.d.ts
CHANGED
|
@@ -521,9 +521,11 @@ export type ApiMethods<F> = {
|
|
|
521
521
|
/** An object for a new inline keyboard. */
|
|
522
522
|
reply_markup?: InlineKeyboardMarkup;
|
|
523
523
|
}): (Update.Edited & Message.LocationMessage) | true;
|
|
524
|
-
/** Use this method to send paid media
|
|
524
|
+
/** Use this method to send paid media. On success, the sent Message is returned. */
|
|
525
525
|
sendPaidMedia(args: {
|
|
526
|
-
/** Unique identifier
|
|
526
|
+
/** Unique identifier of the business connection on behalf of which the message to be edited was sent */
|
|
527
|
+
business_connection_id?: string;
|
|
528
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance. */
|
|
527
529
|
chat_id: number | string;
|
|
528
530
|
/** The number of Telegram Stars that must be paid to buy access to the media */
|
|
529
531
|
star_count: number;
|
|
@@ -699,13 +701,13 @@ export type ApiMethods<F> = {
|
|
|
699
701
|
/** Unique identifier for the target message thread; for supergroups only */
|
|
700
702
|
message_thread_id?: number;
|
|
701
703
|
}): true;
|
|
702
|
-
/** Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel.
|
|
704
|
+
/** Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success. */
|
|
703
705
|
setMessageReaction(args: {
|
|
704
706
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
705
707
|
chat_id: number | string;
|
|
706
708
|
/** Identifier of the target message */
|
|
707
709
|
message_id: number;
|
|
708
|
-
/** A list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. */
|
|
710
|
+
/** A list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots. */
|
|
709
711
|
reaction?: ReactionType[];
|
|
710
712
|
/** Pass True to set the reaction with a big animation */
|
|
711
713
|
is_big?: boolean;
|
|
@@ -866,6 +868,26 @@ export type ApiMethods<F> = {
|
|
|
866
868
|
/** True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified */
|
|
867
869
|
creates_join_request?: boolean;
|
|
868
870
|
}): ChatInviteLink;
|
|
871
|
+
/** Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object. */
|
|
872
|
+
createChatSubscriptionInviteLink(args: {
|
|
873
|
+
/** Unique identifier for the target channel chat or username of the target channel (in the format @channelusername) */
|
|
874
|
+
chat_id: number | string;
|
|
875
|
+
/** Invite link name; 0-32 characters */
|
|
876
|
+
name?: string;
|
|
877
|
+
/** The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). */
|
|
878
|
+
subscription_period: number;
|
|
879
|
+
/** The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500 */
|
|
880
|
+
subscription_price: number;
|
|
881
|
+
}): ChatInviteLink;
|
|
882
|
+
/** Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object. */
|
|
883
|
+
editChatSubscriptionInviteLink(args: {
|
|
884
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
885
|
+
chat_id: number | string;
|
|
886
|
+
/** The invite link to edit */
|
|
887
|
+
invite_link: string;
|
|
888
|
+
/** Invite link name; 0-32 characters */
|
|
889
|
+
name?: string;
|
|
890
|
+
}): ChatInviteLink;
|
|
869
891
|
/** Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object. */
|
|
870
892
|
revokeChatInviteLink(args: {
|
|
871
893
|
/** Unique identifier of the target chat or username of the target channel (in the format @channelusername) */
|
|
@@ -993,7 +1015,7 @@ export type ApiMethods<F> = {
|
|
|
993
1015
|
/** Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. */
|
|
994
1016
|
icon_custom_emoji_id?: string;
|
|
995
1017
|
}): ForumTopic;
|
|
996
|
-
/** Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. */
|
|
1018
|
+
/** Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success. */
|
|
997
1019
|
editForumTopic(args: {
|
|
998
1020
|
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
999
1021
|
chat_id: number | string;
|
|
@@ -1032,7 +1054,7 @@ export type ApiMethods<F> = {
|
|
|
1032
1054
|
/** Unique identifier for the target message thread of the forum topic */
|
|
1033
1055
|
message_thread_id: number;
|
|
1034
1056
|
}): true;
|
|
1035
|
-
/** Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success. */
|
|
1057
|
+
/** Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success. */
|
|
1036
1058
|
editGeneralForumTopic(args: {
|
|
1037
1059
|
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
1038
1060
|
chat_id: number | string;
|
package/package.json
CHANGED
package/payment.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { User } from "./manage.js";
|
|
2
|
+
import type { PaidMedia } from "./message.js";
|
|
2
3
|
/** This object represents a portion of the price for goods or services. */
|
|
3
4
|
export interface LabeledPrice {
|
|
4
5
|
/** Portion label */
|
|
@@ -152,6 +153,8 @@ export interface TransactionPartnerUser {
|
|
|
152
153
|
user: User;
|
|
153
154
|
/** Bot-specified invoice payload */
|
|
154
155
|
invoice_payload?: string;
|
|
156
|
+
/** Information about the paid media bought by the user */
|
|
157
|
+
paid_media?: PaidMedia[];
|
|
155
158
|
}
|
|
156
159
|
/** Describes a withdrawal transaction with Fragment. */
|
|
157
160
|
export interface TransactionPartnerFragment {
|