@yaebal/contexts 0.0.1 → 0.0.3
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/lib/generated/business-connection.d.ts +2 -2
- package/lib/generated/business-connection.js +2 -2
- package/lib/generated/business-message.d.ts +77 -33
- package/lib/generated/business-message.d.ts.map +1 -1
- package/lib/generated/business-message.js +130 -42
- package/lib/generated/business-message.js.map +1 -1
- package/lib/generated/callback-query.d.ts +73 -29
- package/lib/generated/callback-query.d.ts.map +1 -1
- package/lib/generated/callback-query.js +126 -38
- package/lib/generated/callback-query.js.map +1 -1
- package/lib/generated/channel-post.d.ts +77 -33
- package/lib/generated/channel-post.d.ts.map +1 -1
- package/lib/generated/channel-post.js +130 -42
- package/lib/generated/channel-post.js.map +1 -1
- package/lib/generated/chat-boost.d.ts +34 -20
- package/lib/generated/chat-boost.d.ts.map +1 -1
- package/lib/generated/chat-boost.js +51 -23
- package/lib/generated/chat-boost.js.map +1 -1
- package/lib/generated/chat-join-request.d.ts +63 -29
- package/lib/generated/chat-join-request.d.ts.map +1 -1
- package/lib/generated/chat-join-request.js +106 -38
- package/lib/generated/chat-join-request.js.map +1 -1
- package/lib/generated/chat-member.d.ts +63 -29
- package/lib/generated/chat-member.d.ts.map +1 -1
- package/lib/generated/chat-member.js +106 -38
- package/lib/generated/chat-member.js.map +1 -1
- package/lib/generated/chosen-inline-result.d.ts +29 -11
- package/lib/generated/chosen-inline-result.d.ts.map +1 -1
- package/lib/generated/chosen-inline-result.js +54 -18
- package/lib/generated/chosen-inline-result.js.map +1 -1
- package/lib/generated/deleted-business-messages.d.ts +34 -20
- package/lib/generated/deleted-business-messages.d.ts.map +1 -1
- package/lib/generated/deleted-business-messages.js +51 -23
- package/lib/generated/deleted-business-messages.js.map +1 -1
- package/lib/generated/edited-business-message.d.ts +77 -33
- package/lib/generated/edited-business-message.d.ts.map +1 -1
- package/lib/generated/edited-business-message.js +130 -42
- package/lib/generated/edited-business-message.js.map +1 -1
- package/lib/generated/edited-channel-post.d.ts +77 -33
- package/lib/generated/edited-channel-post.d.ts.map +1 -1
- package/lib/generated/edited-channel-post.js +130 -42
- package/lib/generated/edited-channel-post.js.map +1 -1
- package/lib/generated/edited-message.d.ts +77 -33
- package/lib/generated/edited-message.d.ts.map +1 -1
- package/lib/generated/edited-message.js +130 -42
- package/lib/generated/edited-message.js.map +1 -1
- package/lib/generated/guest-message.d.ts +252 -0
- package/lib/generated/guest-message.d.ts.map +1 -0
- package/lib/generated/guest-message.js +494 -0
- package/lib/generated/guest-message.js.map +1 -0
- package/lib/generated/index.d.ts +8 -2
- package/lib/generated/index.d.ts.map +1 -1
- package/lib/generated/index.js +7 -1
- package/lib/generated/index.js.map +1 -1
- package/lib/generated/inline-query.d.ts +30 -12
- package/lib/generated/inline-query.d.ts.map +1 -1
- package/lib/generated/inline-query.js +56 -20
- package/lib/generated/inline-query.js.map +1 -1
- package/lib/generated/managed-bot.d.ts +14 -0
- package/lib/generated/managed-bot.d.ts.map +1 -0
- package/lib/generated/managed-bot.js +18 -0
- package/lib/generated/managed-bot.js.map +1 -0
- package/lib/generated/message-reaction-count.d.ts +47 -23
- package/lib/generated/message-reaction-count.d.ts.map +1 -1
- package/lib/generated/message-reaction-count.js +74 -26
- package/lib/generated/message-reaction-count.js.map +1 -1
- package/lib/generated/message-reaction.d.ts +49 -25
- package/lib/generated/message-reaction.d.ts.map +1 -1
- package/lib/generated/message-reaction.js +76 -28
- package/lib/generated/message-reaction.js.map +1 -1
- package/lib/generated/message.d.ts +77 -33
- package/lib/generated/message.d.ts.map +1 -1
- package/lib/generated/message.js +130 -42
- package/lib/generated/message.js.map +1 -1
- package/lib/generated/my-chat-member.d.ts +63 -29
- package/lib/generated/my-chat-member.d.ts.map +1 -1
- package/lib/generated/my-chat-member.js +106 -38
- package/lib/generated/my-chat-member.js.map +1 -1
- package/lib/generated/poll-answer.d.ts +2 -2
- package/lib/generated/poll-answer.js +2 -2
- package/lib/generated/pre-checkout-query.d.ts +29 -11
- package/lib/generated/pre-checkout-query.d.ts.map +1 -1
- package/lib/generated/pre-checkout-query.js +54 -18
- package/lib/generated/pre-checkout-query.js.map +1 -1
- package/lib/generated/purchased-paid-media.d.ts +29 -11
- package/lib/generated/purchased-paid-media.d.ts.map +1 -1
- package/lib/generated/purchased-paid-media.js +54 -18
- package/lib/generated/purchased-paid-media.js.map +1 -1
- package/lib/generated/removed-chat-boost.d.ts +34 -20
- package/lib/generated/removed-chat-boost.d.ts.map +1 -1
- package/lib/generated/removed-chat-boost.js +51 -23
- package/lib/generated/removed-chat-boost.js.map +1 -1
- package/lib/generated/shipping-query.d.ts +29 -11
- package/lib/generated/shipping-query.d.ts.map +1 -1
- package/lib/generated/shipping-query.js +54 -18
- package/lib/generated/shipping-query.js.map +1 -1
- package/lib/index.test.js +1 -1
- package/lib/index.test.js.map +1 -1
- package/lib/sugar/business-message.d.ts +5 -0
- package/lib/sugar/business-message.d.ts.map +1 -1
- package/lib/sugar/channel-post.d.ts +5 -0
- package/lib/sugar/channel-post.d.ts.map +1 -1
- package/lib/sugar/edited-business-message.d.ts +5 -0
- package/lib/sugar/edited-business-message.d.ts.map +1 -1
- package/lib/sugar/edited-channel-post.d.ts +5 -0
- package/lib/sugar/edited-channel-post.d.ts.map +1 -1
- package/lib/sugar/edited-message.d.ts +5 -0
- package/lib/sugar/edited-message.d.ts.map +1 -1
- package/lib/sugar/message.d.ts +5 -0
- package/lib/sugar/message.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/generated/business-connection.ts +3 -3
- package/src/generated/business-message.ts +132 -44
- package/src/generated/callback-query.ts +128 -40
- package/src/generated/channel-post.ts +132 -44
- package/src/generated/chat-boost.ts +53 -25
- package/src/generated/chat-join-request.ts +108 -40
- package/src/generated/chat-member.ts +108 -40
- package/src/generated/chosen-inline-result.ts +55 -19
- package/src/generated/deleted-business-messages.ts +53 -25
- package/src/generated/edited-business-message.ts +132 -44
- package/src/generated/edited-channel-post.ts +132 -44
- package/src/generated/edited-message.ts +132 -44
- package/src/generated/guest-message.ts +498 -0
- package/src/generated/index.ts +11 -3
- package/src/generated/inline-query.ts +57 -21
- package/src/generated/managed-bot.ts +22 -0
- package/src/generated/message-reaction-count.ts +76 -28
- package/src/generated/message-reaction.ts +78 -30
- package/src/generated/message.ts +132 -44
- package/src/generated/my-chat-member.ts +108 -40
- package/src/generated/poll-answer.ts +3 -3
- package/src/generated/poll.ts +1 -1
- package/src/generated/pre-checkout-query.ts +55 -19
- package/src/generated/purchased-paid-media.ts +55 -19
- package/src/generated/removed-chat-boost.ts +53 -25
- package/src/generated/shipping-query.ts +55 -19
- package/src/index.test.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// AUTO-GENERATED — do not edit by hand.
|
|
1
|
+
// AUTO-GENERATED — do not edit by hand. regenerate: pnpm --filter @yaebal/contexts generate
|
|
2
2
|
import type { Api } from "@yaebal/core";
|
|
3
3
|
import type * as t from "@yaebal/types";
|
|
4
4
|
|
|
@@ -11,15 +11,15 @@ export class RemovedChatBoostContext {
|
|
|
11
11
|
this.update = update;
|
|
12
12
|
Object.assign(this, update.removed_chat_boost ?? {});
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
14
|
+
/** id of the chat this update is in. */
|
|
15
15
|
get chatId(): number {
|
|
16
16
|
return this.chat.id;
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
18
|
+
/** whether this is a private (1:1) chat. */
|
|
19
19
|
get isPM(): boolean {
|
|
20
20
|
return this.chat.type === "private";
|
|
21
21
|
}
|
|
22
|
-
/**
|
|
22
|
+
/** whether this is a group or supergroup. */
|
|
23
23
|
get isGroup(): boolean {
|
|
24
24
|
return this.chat.type === "group" || this.chat.type === "supergroup";
|
|
25
25
|
}
|
|
@@ -31,6 +31,10 @@ export class RemovedChatBoostContext {
|
|
|
31
31
|
sendPhoto(params: Omit<t.SendPhotoParams, "chat_id">) {
|
|
32
32
|
return this.api.call<t.Message>("sendPhoto", { chat_id: this.chat.id, ...params });
|
|
33
33
|
}
|
|
34
|
+
/** Use this method to send live photos. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
35
|
+
sendLivePhoto(params: Omit<t.SendLivePhotoParams, "chat_id">) {
|
|
36
|
+
return this.api.call<t.Message>("sendLivePhoto", { chat_id: this.chat.id, ...params });
|
|
37
|
+
}
|
|
34
38
|
/** Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. For sending voice messages, use the [sendVoice](https://core.telegram.org/bots/api/#sendvoice) method instead. */
|
|
35
39
|
sendAudio(params: Omit<t.SendAudioParams, "chat_id">) {
|
|
36
40
|
return this.api.call<t.Message>("sendAudio", { chat_id: this.chat.id, ...params });
|
|
@@ -59,7 +63,7 @@ export class RemovedChatBoostContext {
|
|
|
59
63
|
sendPaidMedia(params: Omit<t.SendPaidMediaParams, "chat_id">) {
|
|
60
64
|
return this.api.call<t.Message>("sendPaidMedia", { chat_id: this.chat.id, ...params });
|
|
61
65
|
}
|
|
62
|
-
/** Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of [
|
|
66
|
+
/** Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of [Message](https://core.telegram.org/bots/api/#message) objects that were sent is returned. */
|
|
63
67
|
sendMediaGroup(params: Omit<t.SendMediaGroupParams, "chat_id">) {
|
|
64
68
|
return this.api.call<t.Message[]>("sendMediaGroup", { chat_id: this.chat.id, ...params });
|
|
65
69
|
}
|
|
@@ -79,10 +83,18 @@ export class RemovedChatBoostContext {
|
|
|
79
83
|
sendPoll(params: Omit<t.SendPollParams, "chat_id">) {
|
|
80
84
|
return this.api.call<t.Message>("sendPoll", { chat_id: this.chat.id, ...params });
|
|
81
85
|
}
|
|
86
|
+
/** Use this method to send a checklist on behalf of a connected business account. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
87
|
+
sendChecklist(params: Omit<t.SendChecklistParams, "chat_id">) {
|
|
88
|
+
return this.api.call<t.Message>("sendChecklist", { chat_id: this.chat.id, ...params });
|
|
89
|
+
}
|
|
82
90
|
/** Use this method to send an animated emoji that will display a random value. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
83
91
|
sendDice(params: Omit<t.SendDiceParams, "chat_id">) {
|
|
84
92
|
return this.api.call<t.Message>("sendDice", { chat_id: this.chat.id, ...params });
|
|
85
93
|
}
|
|
94
|
+
/** Use this method to stream a partial message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you **must** call [sendMessage](https://core.telegram.org/bots/api/#sendmessage) with the complete message to persist it in the user's chat. Returns *True* on success. */
|
|
95
|
+
sendMessageDraft(params: Omit<t.SendMessageDraftParams, "chat_id">) {
|
|
96
|
+
return this.api.call<boolean>("sendMessageDraft", { chat_id: this.chat.id, ...params });
|
|
97
|
+
}
|
|
86
98
|
/** Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns *True* on success. Example: The [ImageBot](https://t.me/imagebot) needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use [sendChatAction](https://core.telegram.org/bots/api/#sendchataction) with *action* = *upload\_photo*. The user will see a “sending photo” status for the bot. We only recommend using this method when a response from the bot will take a **noticeable** amount of time to arrive. */
|
|
87
99
|
sendChatAction(params: Omit<t.SendChatActionParams, "chat_id">) {
|
|
88
100
|
return this.api.call<boolean>("sendChatAction", { chat_id: this.chat.id, ...params });
|
|
@@ -139,11 +151,11 @@ export class RemovedChatBoostContext {
|
|
|
139
151
|
setChatDescription(params: Omit<t.SetChatDescriptionParams, "chat_id">) {
|
|
140
152
|
return this.api.call<boolean>("setChatDescription", { chat_id: this.chat.id, ...params });
|
|
141
153
|
}
|
|
142
|
-
/** Use this method to remove a message from the list of pinned messages in a chat.
|
|
154
|
+
/** Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns *True* on success. */
|
|
143
155
|
unpin(params: Omit<t.UnpinChatMessageParams, "chat_id">) {
|
|
144
156
|
return this.api.call<boolean>("unpinChatMessage", { chat_id: this.chat.id, ...params });
|
|
145
157
|
}
|
|
146
|
-
/** Use this method to clear the list of pinned messages in a chat.
|
|
158
|
+
/** Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns *True* on success. */
|
|
147
159
|
unpinAllChatMessages(params?: Omit<t.UnpinAllChatMessagesParams, "chat_id">) {
|
|
148
160
|
return this.api.call<boolean>("unpinAllChatMessages", { chat_id: this.chat.id, ...params });
|
|
149
161
|
}
|
|
@@ -155,8 +167,8 @@ export class RemovedChatBoostContext {
|
|
|
155
167
|
getChat(params?: Omit<t.GetChatParams, "chat_id">) {
|
|
156
168
|
return this.api.call<t.ChatFullInfo>("getChat", { chat_id: this.chat.id, ...params });
|
|
157
169
|
}
|
|
158
|
-
/** Use this method to get a list of administrators in a chat
|
|
159
|
-
getChatAdministrators(params
|
|
170
|
+
/** Use this method to get a list of administrators in a chat. Returns an Array of [ChatMember](https://core.telegram.org/bots/api/#chatmember) objects. */
|
|
171
|
+
getChatAdministrators(params: Omit<t.GetChatAdministratorsParams, "chat_id">) {
|
|
160
172
|
return this.api.call<t.ChatMember[]>("getChatAdministrators", { chat_id: this.chat.id, ...params });
|
|
161
173
|
}
|
|
162
174
|
/** Use this method to get the number of members in a chat. Returns *Int* on success. */
|
|
@@ -171,11 +183,11 @@ export class RemovedChatBoostContext {
|
|
|
171
183
|
deleteChatStickerSet(params?: Omit<t.DeleteChatStickerSetParams, "chat_id">) {
|
|
172
184
|
return this.api.call<boolean>("deleteChatStickerSet", { chat_id: this.chat.id, ...params });
|
|
173
185
|
}
|
|
174
|
-
/** Use this method to create a topic in a forum supergroup chat.
|
|
186
|
+
/** Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can\_manage\_topics* administrator right. Returns information about the created topic as a [ForumTopic](https://core.telegram.org/bots/api/#forumtopic) object. */
|
|
175
187
|
createForumTopic(params: Omit<t.CreateForumTopicParams, "chat_id">) {
|
|
176
188
|
return this.api.call<t.ForumTopic>("createForumTopic", { chat_id: this.chat.id, ...params });
|
|
177
189
|
}
|
|
178
|
-
/** Use this method to edit name and icon of a topic in a forum supergroup chat.
|
|
190
|
+
/** Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a 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. */
|
|
179
191
|
editForumTopic(params: Omit<t.EditForumTopicParams, "chat_id">) {
|
|
180
192
|
return this.api.call<boolean>("editForumTopic", { chat_id: this.chat.id, ...params });
|
|
181
193
|
}
|
|
@@ -187,11 +199,11 @@ export class RemovedChatBoostContext {
|
|
|
187
199
|
reopenForumTopic(params: Omit<t.ReopenForumTopicParams, "chat_id">) {
|
|
188
200
|
return this.api.call<boolean>("reopenForumTopic", { chat_id: this.chat.id, ...params });
|
|
189
201
|
}
|
|
190
|
-
/** Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
|
|
202
|
+
/** Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can\_delete\_messages* administrator rights. Returns *True* on success. */
|
|
191
203
|
deleteForumTopic(params: Omit<t.DeleteForumTopicParams, "chat_id">) {
|
|
192
204
|
return this.api.call<boolean>("deleteForumTopic", { chat_id: this.chat.id, ...params });
|
|
193
205
|
}
|
|
194
|
-
/** Use this method to clear the list of pinned messages in a forum topic.
|
|
206
|
+
/** Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the *can\_pin\_messages* administrator right in the supergroup. Returns *True* on success. */
|
|
195
207
|
unpinAllForumTopicMessages(params: Omit<t.UnpinAllForumTopicMessagesParams, "chat_id">) {
|
|
196
208
|
return this.api.call<boolean>("unpinAllForumTopicMessages", { chat_id: this.chat.id, ...params });
|
|
197
209
|
}
|
|
@@ -227,7 +239,23 @@ export class RemovedChatBoostContext {
|
|
|
227
239
|
getChatMenuButton(params?: Omit<t.GetChatMenuButtonParams, "chat_id">) {
|
|
228
240
|
return this.api.call<t.MenuButton>("getChatMenuButton", { chat_id: this.chat.id, ...params });
|
|
229
241
|
}
|
|
230
|
-
/**
|
|
242
|
+
/** Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns *True* on success. */
|
|
243
|
+
sendGift(params: Omit<t.SendGiftParams, "chat_id">) {
|
|
244
|
+
return this.api.call<boolean>("sendGift", { chat_id: this.chat.id, ...params });
|
|
245
|
+
}
|
|
246
|
+
/** Verifies a chat [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot. Returns *True* on success. */
|
|
247
|
+
verifyChat(params: Omit<t.VerifyChatParams, "chat_id">) {
|
|
248
|
+
return this.api.call<boolean>("verifyChat", { chat_id: this.chat.id, ...params });
|
|
249
|
+
}
|
|
250
|
+
/** Removes verification from a chat that is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) represented by the bot. Returns *True* on success. */
|
|
251
|
+
removeChatVerification(params?: Omit<t.RemoveChatVerificationParams, "chat_id">) {
|
|
252
|
+
return this.api.call<boolean>("removeChatVerification", { chat_id: this.chat.id, ...params });
|
|
253
|
+
}
|
|
254
|
+
/** Returns the gifts owned by a chat. Returns [OwnedGifts](https://core.telegram.org/bots/api/#ownedgifts) on success. */
|
|
255
|
+
getChatGifts(params: Omit<t.GetChatGiftsParams, "chat_id">) {
|
|
256
|
+
return this.api.call<t.OwnedGifts>("getChatGifts", { chat_id: this.chat.id, ...params });
|
|
257
|
+
}
|
|
258
|
+
/** Use this method to edit text, rich and [game](https://core.telegram.org/bots/api/#games) messages. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent. */
|
|
231
259
|
editText(params: Omit<t.EditMessageTextParams, "chat_id">) {
|
|
232
260
|
return this.api.call<t.Message | boolean>("editMessageText", { chat_id: this.chat.id, ...params });
|
|
233
261
|
}
|
|
@@ -235,7 +263,7 @@ export class RemovedChatBoostContext {
|
|
|
235
263
|
editCaption(params: Omit<t.EditMessageCaptionParams, "chat_id">) {
|
|
236
264
|
return this.api.call<t.Message | boolean>("editMessageCaption", { chat_id: this.chat.id, ...params });
|
|
237
265
|
}
|
|
238
|
-
/** Use this method to edit animation, audio, document, photo, or video messages, or to
|
|
266
|
+
/** Use this method to edit animation, audio, document, live photo, photo, or video messages, or to replace a text or a rich message with a media. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo, a live photo, or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api/#message) is returned, otherwise *True* is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within **48 hours** from the time they were sent. */
|
|
239
267
|
editMedia(params: Omit<t.EditMessageMediaParams, "chat_id">) {
|
|
240
268
|
return this.api.call<t.Message | boolean>("editMessageMedia", { chat_id: this.chat.id, ...params });
|
|
241
269
|
}
|
|
@@ -255,21 +283,21 @@ export class RemovedChatBoostContext {
|
|
|
255
283
|
deleteMessages(params: Omit<t.DeleteMessagesParams, "chat_id">) {
|
|
256
284
|
return this.api.call<boolean>("deleteMessages", { chat_id: this.chat.id, ...params });
|
|
257
285
|
}
|
|
286
|
+
/** Use this method to remove up to 10000 recent reactions in a group or a supergroup chat added by a given user or chat. The bot must have the 'can_delete_messages' administrator right in the chat. Returns *True* on success. */
|
|
287
|
+
deleteAllMessageReactions(params: Omit<t.DeleteAllMessageReactionsParams, "chat_id">) {
|
|
288
|
+
return this.api.call<boolean>("deleteAllMessageReactions", { chat_id: this.chat.id, ...params });
|
|
289
|
+
}
|
|
258
290
|
/** Use this method to send static .WEBP, [animated](https://telegram.org/blog/animated-stickers) .TGS, or [video](https://telegram.org/blog/video-stickers-better-reactions) .WEBM stickers. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
259
291
|
sendSticker(params: Omit<t.SendStickerParams, "chat_id">) {
|
|
260
292
|
return this.api.call<t.Message>("sendSticker", { chat_id: this.chat.id, ...params });
|
|
261
293
|
}
|
|
262
|
-
/**
|
|
263
|
-
|
|
264
|
-
return this.api.call<
|
|
294
|
+
/** Use this method to send rich messages. If the message contains a block with a media element, then the bot must have the right to send the media to the chat. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
295
|
+
sendRichMessage(params: Omit<t.SendRichMessageParams, "chat_id">) {
|
|
296
|
+
return this.api.call<t.Message>("sendRichMessage", { chat_id: this.chat.id, ...params });
|
|
265
297
|
}
|
|
266
|
-
/**
|
|
267
|
-
|
|
268
|
-
return this.api.call<boolean>("
|
|
269
|
-
}
|
|
270
|
-
/** Removes verification from a chat that is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) represented by the bot. Returns *True* on success. */
|
|
271
|
-
removeChatVerification(params?: Omit<t.RemoveChatVerificationParams, "chat_id">) {
|
|
272
|
-
return this.api.call<boolean>("removeChatVerification", { chat_id: this.chat.id, ...params });
|
|
298
|
+
/** Use this method to stream a partial rich message to a user while the message is being generated. Note that the streamed draft is ephemeral and acts as a temporary 30-second preview - once the output is finalized, you **must** call [sendRichMessage](https://core.telegram.org/bots/api/#sendrichmessage) with the complete message to persist it in the user's chat. Returns *True* on success. */
|
|
299
|
+
sendRichMessageDraft(params: Omit<t.SendRichMessageDraftParams, "chat_id">) {
|
|
300
|
+
return this.api.call<boolean>("sendRichMessageDraft", { chat_id: this.chat.id, ...params });
|
|
273
301
|
}
|
|
274
302
|
/** Use this method to send invoices. On success, the sent [Message](https://core.telegram.org/bots/api/#message) is returned. */
|
|
275
303
|
sendInvoice(params: Omit<t.SendInvoiceParams, "chat_id">) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// AUTO-GENERATED — do not edit by hand.
|
|
1
|
+
// AUTO-GENERATED — do not edit by hand. regenerate: pnpm --filter @yaebal/contexts generate
|
|
2
2
|
import type { Api } from "@yaebal/core";
|
|
3
3
|
import type * as t from "@yaebal/types";
|
|
4
4
|
|
|
@@ -11,11 +11,11 @@ export class ShippingQueryContextBase {
|
|
|
11
11
|
this.update = update;
|
|
12
12
|
Object.assign(this, update.shipping_query ?? {});
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
14
|
+
/** id of the user this update is from. */
|
|
15
15
|
get senderId(): number {
|
|
16
16
|
return this.from.id;
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
18
|
+
/** first name of the user this update is from. */
|
|
19
19
|
get firstName(): string | undefined {
|
|
20
20
|
return this.from.first_name;
|
|
21
21
|
}
|
|
@@ -23,34 +23,42 @@ export class ShippingQueryContextBase {
|
|
|
23
23
|
getUserProfilePhotos(params: Omit<t.GetUserProfilePhotosParams, "user_id">) {
|
|
24
24
|
return this.api.call<t.UserProfilePhotos>("getUserProfilePhotos", { user_id: this.from.id, ...params });
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
26
|
+
/** Use this method to get a list of profile audios for a user. Returns a [UserProfileAudios](https://core.telegram.org/bots/api/#userprofileaudios) object. */
|
|
27
|
+
getUserProfileAudios(params: Omit<t.GetUserProfileAudiosParams, "user_id">) {
|
|
28
|
+
return this.api.call<t.UserProfileAudios>("getUserProfileAudios", { user_id: this.from.id, ...params });
|
|
29
|
+
}
|
|
30
|
+
/** Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method [requestEmojiStatusAccess](/bots/webapps#initializing-mini-apps). Returns *True* on success. */
|
|
27
31
|
setUserEmojiStatus(params: Omit<t.SetUserEmojiStatusParams, "user_id">) {
|
|
28
32
|
return this.api.call<boolean>("setUserEmojiStatus", { user_id: this.from.id, ...params });
|
|
29
33
|
}
|
|
30
|
-
/** Use this method to
|
|
31
|
-
|
|
32
|
-
return this.api.call<t.
|
|
34
|
+
/** Use this method to get the last messages from the personal chat (i.e., the chat currently added to their profile) of a given user. On success, an array of [Message](https://core.telegram.org/bots/api/#message) objects is returned. */
|
|
35
|
+
getUserPersonalChatMessages(params: Omit<t.GetUserPersonalChatMessagesParams, "user_id">) {
|
|
36
|
+
return this.api.call<t.Message[]>("getUserPersonalChatMessages", { user_id: this.from.id, ...params });
|
|
33
37
|
}
|
|
34
|
-
/** Use this method to
|
|
35
|
-
|
|
36
|
-
return this.api.call<
|
|
38
|
+
/** Use this method to get the token of a managed bot. Returns the token as *String* on success. */
|
|
39
|
+
getManagedBotToken(params?: Omit<t.GetManagedBotTokenParams, "user_id">) {
|
|
40
|
+
return this.api.call<string>("getManagedBotToken", { user_id: this.from.id, ...params });
|
|
37
41
|
}
|
|
38
|
-
/** Use this method to
|
|
39
|
-
|
|
40
|
-
return this.api.call<
|
|
42
|
+
/** Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as *String* on success. */
|
|
43
|
+
replaceManagedBotToken(params?: Omit<t.ReplaceManagedBotTokenParams, "user_id">) {
|
|
44
|
+
return this.api.call<string>("replaceManagedBotToken", { user_id: this.from.id, ...params });
|
|
41
45
|
}
|
|
42
|
-
/** Use this method to
|
|
43
|
-
|
|
44
|
-
return this.api.call<
|
|
46
|
+
/** Use this method to get the access settings of a managed bot. Returns a [BotAccessSettings](https://core.telegram.org/bots/api/#botaccesssettings) object on success. */
|
|
47
|
+
getManagedBotAccessSettings(params?: Omit<t.GetManagedBotAccessSettingsParams, "user_id">) {
|
|
48
|
+
return this.api.call<t.BotAccessSettings>("getManagedBotAccessSettings", { user_id: this.from.id, ...params });
|
|
45
49
|
}
|
|
46
|
-
/** Use this method to
|
|
47
|
-
|
|
48
|
-
return this.api.call<boolean>("
|
|
50
|
+
/** Use this method to change the access settings of a managed bot. Returns *True* on success. */
|
|
51
|
+
setManagedBotAccessSettings(params: Omit<t.SetManagedBotAccessSettingsParams, "user_id">) {
|
|
52
|
+
return this.api.call<boolean>("setManagedBotAccessSettings", { user_id: this.from.id, ...params });
|
|
49
53
|
}
|
|
50
54
|
/** Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns *True* on success. */
|
|
51
55
|
sendGift(params: Omit<t.SendGiftParams, "user_id">) {
|
|
52
56
|
return this.api.call<boolean>("sendGift", { user_id: this.from.id, ...params });
|
|
53
57
|
}
|
|
58
|
+
/** Gifts a Telegram Premium subscription to the given user. Returns *True* on success. */
|
|
59
|
+
giftPremiumSubscription(params: Omit<t.GiftPremiumSubscriptionParams, "user_id">) {
|
|
60
|
+
return this.api.call<boolean>("giftPremiumSubscription", { user_id: this.from.id, ...params });
|
|
61
|
+
}
|
|
54
62
|
/** Verifies a user [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot. Returns *True* on success. */
|
|
55
63
|
verifyUser(params: Omit<t.VerifyUserParams, "user_id">) {
|
|
56
64
|
return this.api.call<boolean>("verifyUser", { user_id: this.from.id, ...params });
|
|
@@ -59,10 +67,38 @@ export class ShippingQueryContextBase {
|
|
|
59
67
|
removeUserVerification(params?: Omit<t.RemoveUserVerificationParams, "user_id">) {
|
|
60
68
|
return this.api.call<boolean>("removeUserVerification", { user_id: this.from.id, ...params });
|
|
61
69
|
}
|
|
70
|
+
/** Returns the gifts owned and hosted by a user. Returns [OwnedGifts](https://core.telegram.org/bots/api/#ownedgifts) on success. */
|
|
71
|
+
getUserGifts(params: Omit<t.GetUserGiftsParams, "user_id">) {
|
|
72
|
+
return this.api.call<t.OwnedGifts>("getUserGifts", { user_id: this.from.id, ...params });
|
|
73
|
+
}
|
|
62
74
|
/** Stores a message that can be sent by a user of a Mini App. Returns a [PreparedInlineMessage](https://core.telegram.org/bots/api/#preparedinlinemessage) object. */
|
|
63
75
|
savePreparedInlineMessage(params: Omit<t.SavePreparedInlineMessageParams, "user_id">) {
|
|
64
76
|
return this.api.call<t.PreparedInlineMessage>("savePreparedInlineMessage", { user_id: this.from.id, ...params });
|
|
65
77
|
}
|
|
78
|
+
/** Stores a keyboard button that can be used by a user within a Mini App. Returns a [PreparedKeyboardButton](https://core.telegram.org/bots/api/#preparedkeyboardbutton) object. */
|
|
79
|
+
savePreparedKeyboardButton(params: Omit<t.SavePreparedKeyboardButtonParams, "user_id">) {
|
|
80
|
+
return this.api.call<t.PreparedKeyboardButton>("savePreparedKeyboardButton", { user_id: this.from.id, ...params });
|
|
81
|
+
}
|
|
82
|
+
/** Use this method to upload a file with a sticker for later use in the [createNewStickerSet](https://core.telegram.org/bots/api/#createnewstickerset), [addStickerToSet](https://core.telegram.org/bots/api/#addstickertoset), or [replaceStickerInSet](https://core.telegram.org/bots/api/#replacestickerinset) methods (the file can be used multiple times). Returns the uploaded [File](https://core.telegram.org/bots/api/#file) on success. */
|
|
83
|
+
uploadStickerFile(params: Omit<t.UploadStickerFileParams, "user_id">) {
|
|
84
|
+
return this.api.call<t.File>("uploadStickerFile", { user_id: this.from.id, ...params });
|
|
85
|
+
}
|
|
86
|
+
/** Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns *True* on success. */
|
|
87
|
+
createNewStickerSet(params: Omit<t.CreateNewStickerSetParams, "user_id">) {
|
|
88
|
+
return this.api.call<boolean>("createNewStickerSet", { user_id: this.from.id, ...params });
|
|
89
|
+
}
|
|
90
|
+
/** Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns *True* on success. */
|
|
91
|
+
addStickerToSet(params: Omit<t.AddStickerToSetParams, "user_id">) {
|
|
92
|
+
return this.api.call<boolean>("addStickerToSet", { user_id: this.from.id, ...params });
|
|
93
|
+
}
|
|
94
|
+
/** Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling [deleteStickerFromSet](https://core.telegram.org/bots/api/#deletestickerfromset), then [addStickerToSet](https://core.telegram.org/bots/api/#addstickertoset), then [setStickerPositionInSet](https://core.telegram.org/bots/api/#setstickerpositioninset). Returns *True* on success. */
|
|
95
|
+
replaceStickerInSet(params: Omit<t.ReplaceStickerInSetParams, "user_id">) {
|
|
96
|
+
return this.api.call<boolean>("replaceStickerInSet", { user_id: this.from.id, ...params });
|
|
97
|
+
}
|
|
98
|
+
/** Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns *True* on success. */
|
|
99
|
+
setStickerSetThumbnail(params: Omit<t.SetStickerSetThumbnailParams, "user_id">) {
|
|
100
|
+
return this.api.call<boolean>("setStickerSetThumbnail", { user_id: this.from.id, ...params });
|
|
101
|
+
}
|
|
66
102
|
/** If you sent an invoice requesting a shipping address and the parameter *is\_flexible* was specified, the Bot API will send an [Update](https://core.telegram.org/bots/api/#update) with a *shipping\_query* field to the bot. Use this method to reply to shipping queries. On success, *True* is returned. */
|
|
67
103
|
answer(params: Omit<t.AnswerShippingQueryParams, "shipping_query_id">) {
|
|
68
104
|
return this.api.call<boolean>("answerShippingQuery", { shipping_query_id: this.id, ...params });
|