@apicity/telegram 0.5.0 → 0.5.1

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.
@@ -1,149 +1,1395 @@
1
- import { TelegramError } from "./types.js";
2
- import { TelegramSendAudioRequestSchema, TelegramSendMessageRequestSchema, TelegramSendPhotoRequestSchema, TelegramSendVideoRequestSchema, } from "./zod.js";
3
1
  import { attachExamples } from "./example.js";
4
- export function createTelegram(opts) {
5
- const baseURL = (opts.baseURL ?? "https://api.telegram.org/bot{token}")
6
- .replace("{token}", opts.botToken)
7
- .replace(/\/+$/, "");
8
- const doFetch = opts.fetch ?? fetch;
9
- const timeout = opts.timeout ?? 30000;
10
- function attachAbortHandler(signal, controller) {
11
- if (signal.aborted) {
12
- controller.abort();
13
- return;
14
- }
15
- signal.addEventListener("abort", () => controller.abort(), { once: true });
16
- }
17
- function formatErrorMessage(status, body) {
18
- if (typeof body === "object" && body !== null) {
19
- const b = body;
20
- if (b.description) {
21
- return `Telegram API error ${status}: ${b.description}`;
22
- }
23
- }
24
- return `Telegram API error: ${status}`;
2
+ import { TelegramError } from "./types.js";
3
+ import { TelegramOptionsSchema, TelegramApproveSuggestedPostRequestSchema, TelegramDeclineSuggestedPostRequestSchema, TelegramGetUserProfileAudiosRequestSchema, TelegramGetUserProfilePhotosRequestSchema, TelegramRemoveMyProfilePhotoRequestSchema, TelegramSetMyProfilePhotoRequestSchema, TelegramAddStickerToSetRequestSchema, TelegramAnswerCallbackQueryRequestSchema, TelegramAnswerChatJoinRequestQueryRequestSchema, TelegramAnswerGuestQueryRequestSchema, TelegramAnswerInlineQueryRequestSchema, TelegramAnswerPreCheckoutQueryRequestSchema, TelegramAnswerShippingQueryRequestSchema, TelegramAnswerWebAppQueryRequestSchema, TelegramApproveChatJoinRequestRequestSchema, TelegramBanChatMemberRequestSchema, TelegramBanChatSenderChatRequestSchema, TelegramCloseRequestSchema, TelegramCloseForumTopicRequestSchema, TelegramCloseGeneralForumTopicRequestSchema, TelegramConvertGiftToStarsRequestSchema, TelegramCopyMessageRequestSchema, TelegramCopyMessagesRequestSchema, TelegramCreateChatInviteLinkRequestSchema, TelegramCreateChatSubscriptionInviteLinkRequestSchema, TelegramCreateForumTopicRequestSchema, TelegramCreateInvoiceLinkRequestSchema, TelegramCreateNewStickerSetRequestSchema, TelegramDeclineChatJoinRequestRequestSchema, TelegramDeleteAllMessageReactionsRequestSchema, TelegramDeleteBusinessMessagesRequestSchema, TelegramDeleteChatPhotoRequestSchema, TelegramDeleteChatStickerSetRequestSchema, TelegramDeleteForumTopicRequestSchema, TelegramDeleteMessageRequestSchema, TelegramDeleteMessageReactionRequestSchema, TelegramDeleteMessagesRequestSchema, TelegramDeleteMyCommandsRequestSchema, TelegramDeleteStickerFromSetRequestSchema, TelegramDeleteStickerSetRequestSchema, TelegramDeleteStoryRequestSchema, TelegramDeleteWebhookRequestSchema, TelegramEditChatInviteLinkRequestSchema, TelegramEditChatSubscriptionInviteLinkRequestSchema, TelegramEditForumTopicRequestSchema, TelegramEditGeneralForumTopicRequestSchema, TelegramEditMessageCaptionRequestSchema, TelegramEditMessageChecklistRequestSchema, TelegramEditMessageLiveLocationRequestSchema, TelegramEditMessageMediaRequestSchema, TelegramEditMessageReplyMarkupRequestSchema, TelegramEditMessageTextRequestSchema, TelegramEditStoryRequestSchema, TelegramEditUserStarSubscriptionRequestSchema, TelegramExportChatInviteLinkRequestSchema, TelegramForwardMessageRequestSchema, TelegramForwardMessagesRequestSchema, TelegramGetAvailableGiftsRequestSchema, TelegramGetBusinessAccountGiftsRequestSchema, TelegramGetBusinessAccountStarBalanceRequestSchema, TelegramGetBusinessConnectionRequestSchema, TelegramGetChatRequestSchema, TelegramGetChatAdministratorsRequestSchema, TelegramGetChatGiftsRequestSchema, TelegramGetChatMemberRequestSchema, TelegramGetChatMemberCountRequestSchema, TelegramGetChatMenuButtonRequestSchema, TelegramGetCustomEmojiStickersRequestSchema, TelegramGetFileRequestSchema, TelegramGetForumTopicIconStickersRequestSchema, TelegramGetGameHighScoresRequestSchema, TelegramGetManagedBotAccessSettingsRequestSchema, TelegramGetManagedBotTokenRequestSchema, TelegramGetMeRequestSchema, TelegramGetMyCommandsRequestSchema, TelegramGetMyDefaultAdministratorRightsRequestSchema, TelegramGetMyDescriptionRequestSchema, TelegramGetMyNameRequestSchema, TelegramGetMyShortDescriptionRequestSchema, TelegramGetMyStarBalanceRequestSchema, TelegramGetStarTransactionsRequestSchema, TelegramGetStickerSetRequestSchema, TelegramGetUpdatesRequestSchema, TelegramGetUserChatBoostsRequestSchema, TelegramGetUserGiftsRequestSchema, TelegramGetUserPersonalChatMessagesRequestSchema, TelegramGetWebhookInfoRequestSchema, TelegramGiftPremiumSubscriptionRequestSchema, TelegramHideGeneralForumTopicRequestSchema, TelegramLeaveChatRequestSchema, TelegramLogOutRequestSchema, TelegramPinChatMessageRequestSchema, TelegramPostStoryRequestSchema, TelegramPromoteChatMemberRequestSchema, TelegramReadBusinessMessageRequestSchema, TelegramRefundStarPaymentRequestSchema, TelegramRemoveBusinessAccountProfilePhotoRequestSchema, TelegramRemoveChatVerificationRequestSchema, TelegramRemoveUserVerificationRequestSchema, TelegramReopenForumTopicRequestSchema, TelegramReopenGeneralForumTopicRequestSchema, TelegramReplaceManagedBotTokenRequestSchema, TelegramReplaceStickerInSetRequestSchema, TelegramRepostStoryRequestSchema, TelegramRestrictChatMemberRequestSchema, TelegramRevokeChatInviteLinkRequestSchema, TelegramSavePreparedInlineMessageRequestSchema, TelegramSavePreparedKeyboardButtonRequestSchema, TelegramSendAnimationRequestSchema, TelegramSendAudioRequestSchema, TelegramSendChatActionRequestSchema, TelegramSendChatJoinRequestWebAppRequestSchema, TelegramSendChecklistRequestSchema, TelegramSendContactRequestSchema, TelegramSendDiceRequestSchema, TelegramSendDocumentRequestSchema, TelegramSendGameRequestSchema, TelegramSendGiftRequestSchema, TelegramSendInvoiceRequestSchema, TelegramSendLivePhotoRequestSchema, TelegramSendLocationRequestSchema, TelegramSendMediaGroupRequestSchema, TelegramSendMessageRequestSchema, TelegramSendMessageDraftRequestSchema, TelegramSendPaidMediaRequestSchema, TelegramSendPhotoRequestSchema, TelegramSendPollRequestSchema, TelegramSendRichMessageRequestSchema, TelegramSendRichMessageDraftRequestSchema, TelegramSendStickerRequestSchema, TelegramSendVenueRequestSchema, TelegramSendVideoRequestSchema, TelegramSendVideoNoteRequestSchema, TelegramSendVoiceRequestSchema, TelegramSetBusinessAccountBioRequestSchema, TelegramSetBusinessAccountGiftSettingsRequestSchema, TelegramSetBusinessAccountNameRequestSchema, TelegramSetBusinessAccountProfilePhotoRequestSchema, TelegramSetBusinessAccountUsernameRequestSchema, TelegramSetChatAdministratorCustomTitleRequestSchema, TelegramSetChatDescriptionRequestSchema, TelegramSetChatMemberTagRequestSchema, TelegramSetChatMenuButtonRequestSchema, TelegramSetChatPermissionsRequestSchema, TelegramSetChatPhotoRequestSchema, TelegramSetChatStickerSetRequestSchema, TelegramSetChatTitleRequestSchema, TelegramSetCustomEmojiStickerSetThumbnailRequestSchema, TelegramSetGameScoreRequestSchema, TelegramSetManagedBotAccessSettingsRequestSchema, TelegramSetMessageReactionRequestSchema, TelegramSetMyCommandsRequestSchema, TelegramSetMyDefaultAdministratorRightsRequestSchema, TelegramSetMyDescriptionRequestSchema, TelegramSetMyNameRequestSchema, TelegramSetMyShortDescriptionRequestSchema, TelegramSetPassportDataErrorsRequestSchema, TelegramSetStickerEmojiListRequestSchema, TelegramSetStickerKeywordsRequestSchema, TelegramSetStickerMaskPositionRequestSchema, TelegramSetStickerPositionInSetRequestSchema, TelegramSetStickerSetThumbnailRequestSchema, TelegramSetStickerSetTitleRequestSchema, TelegramSetUserEmojiStatusRequestSchema, TelegramSetWebhookRequestSchema, TelegramStopMessageLiveLocationRequestSchema, TelegramStopPollRequestSchema, TelegramTransferBusinessAccountStarsRequestSchema, TelegramTransferGiftRequestSchema, TelegramUnbanChatMemberRequestSchema, TelegramUnbanChatSenderChatRequestSchema, TelegramUnhideGeneralForumTopicRequestSchema, TelegramUnpinAllChatMessagesRequestSchema, TelegramUnpinAllForumTopicMessagesRequestSchema, TelegramUnpinAllGeneralForumTopicMessagesRequestSchema, TelegramUnpinChatMessageRequestSchema, TelegramUpgradeGiftRequestSchema, TelegramUploadStickerFileRequestSchema, TelegramVerifyChatRequestSchema, TelegramVerifyUserRequestSchema, } from "./zod.js";
4
+ function encodeToken(token) {
5
+ return encodeURIComponent(token).replace(/%3A/gi, ":");
6
+ }
7
+ function hasBlob(value) {
8
+ if (value instanceof Blob)
9
+ return true;
10
+ if (Array.isArray(value))
11
+ return value.some(hasBlob);
12
+ if (typeof value === "object" && value !== null) {
13
+ return Object.values(value).some(hasBlob);
25
14
  }
26
- function errorCode(body) {
27
- if (typeof body === "object" && body !== null) {
28
- const code = body.error_code;
29
- if (typeof code === "number")
30
- return String(code);
31
- }
15
+ return false;
16
+ }
17
+ function attachmentName(path) {
18
+ return path
19
+ .map((part) => String(part).replace(/[^A-Za-z0-9_]+/g, "_"))
20
+ .filter(Boolean)
21
+ .join("_");
22
+ }
23
+ function multipartJsonValue(form, value, path) {
24
+ if (value === undefined)
32
25
  return undefined;
26
+ if (value === null)
27
+ return null;
28
+ if (value instanceof Blob) {
29
+ const name = attachmentName(path);
30
+ form.append(name, value);
31
+ return "attach://" + name;
33
32
  }
34
- function hasBlob(value) {
35
- if (value instanceof Blob)
36
- return true;
37
- if (Array.isArray(value))
38
- return value.some(hasBlob);
39
- if (typeof value === "object" && value !== null) {
40
- return Object.values(value).some(hasBlob);
41
- }
42
- return false;
33
+ if (Array.isArray(value)) {
34
+ return value.map((item, index) => multipartJsonValue(form, item, [...path, index]));
43
35
  }
44
- function appendFormField(form, key, value) {
45
- if (value === undefined || value === null)
46
- return;
47
- if (value instanceof Blob) {
48
- form.append(key, value);
49
- return;
50
- }
51
- if (typeof value === "string") {
52
- form.append(key, value);
53
- return;
54
- }
55
- if (typeof value === "boolean" || typeof value === "number") {
56
- form.append(key, String(value));
57
- return;
36
+ if (typeof value === "object") {
37
+ const out = {};
38
+ for (const [key, item] of Object.entries(value)) {
39
+ const encoded = multipartJsonValue(form, item, [...path, key]);
40
+ if (encoded !== undefined)
41
+ out[key] = encoded;
58
42
  }
59
- form.append(key, JSON.stringify(value));
43
+ return out;
60
44
  }
61
- function multipartBody(body) {
62
- const form = new FormData();
63
- if (typeof body !== "object" || body === null || Array.isArray(body)) {
64
- return form;
65
- }
66
- for (const [key, value] of Object.entries(body)) {
67
- appendFormField(form, key, value);
45
+ return value;
46
+ }
47
+ function appendFormField(form, key, value) {
48
+ if (value === undefined || value === null)
49
+ return;
50
+ if (value instanceof Blob) {
51
+ form.append(key, value);
52
+ return;
53
+ }
54
+ if (typeof value === "object") {
55
+ form.append(key, JSON.stringify(multipartJsonValue(form, value, [key])));
56
+ return;
57
+ }
58
+ form.append(key, String(value));
59
+ }
60
+ function toRequestBody(req) {
61
+ if (!hasBlob(req)) {
62
+ return {
63
+ body: JSON.stringify(req),
64
+ headers: { "Content-Type": "application/json" },
65
+ };
66
+ }
67
+ const form = new FormData();
68
+ for (const [key, value] of Object.entries(req)) {
69
+ appendFormField(form, key, value);
70
+ }
71
+ return { body: form };
72
+ }
73
+ function errorCode(body) {
74
+ if (typeof body === "object" && body !== null) {
75
+ const code = body.error_code;
76
+ if (typeof code === "number")
77
+ return String(code);
78
+ }
79
+ return undefined;
80
+ }
81
+ function errorMessage(status, body) {
82
+ if (typeof body === "object" && body !== null) {
83
+ const description = body.description;
84
+ if (typeof description === "string" && description.length > 0) {
85
+ return "Telegram API error " + status + ": " + description;
68
86
  }
69
- return form;
70
87
  }
71
- async function makeRequest(path, body, signal) {
88
+ return "Telegram API error: " + status;
89
+ }
90
+ export function createTelegram(opts) {
91
+ const parsedOptions = TelegramOptionsSchema.parse(opts);
92
+ const baseURL = (parsedOptions.baseURL ?? "https://api.telegram.org/bot{token}").replace("{token}", encodeToken(parsedOptions.botToken));
93
+ const fetchImpl = parsedOptions.fetch ?? fetch;
94
+ const timeout = parsedOptions.timeout ?? 30000;
95
+ async function makeRequest(path, rawReq, signal, schema) {
96
+ const req = schema.parse(rawReq ?? {});
72
97
  const controller = new AbortController();
73
98
  const timeoutId = setTimeout(() => controller.abort(), timeout);
74
- if (signal) {
75
- attachAbortHandler(signal, controller);
76
- }
99
+ const requestSignal = signal ?? controller.signal;
77
100
  try {
78
- const headers = {};
79
- const init = {
101
+ const { body, headers } = toRequestBody(req);
102
+ const res = await fetchImpl(baseURL + path, {
80
103
  method: "POST",
81
- signal: controller.signal,
82
- };
83
- if (hasBlob(body)) {
84
- init.body = multipartBody(body);
85
- }
86
- else {
87
- headers["Content-Type"] = "application/json";
88
- init.headers = headers;
89
- init.body = JSON.stringify(body);
90
- }
91
- const res = await doFetch(`${baseURL}${path}`, init);
92
- clearTimeout(timeoutId);
104
+ headers,
105
+ body,
106
+ signal: requestSignal,
107
+ });
93
108
  if (!res.ok) {
94
- let resBody = null;
109
+ let errorBody = null;
95
110
  try {
96
- resBody = await res.json();
111
+ errorBody = await res.json();
97
112
  }
98
113
  catch {
99
- // ignore parse errors
114
+ errorBody = await res.text();
100
115
  }
101
- throw new TelegramError(formatErrorMessage(res.status, resBody), res.status, resBody, errorCode(resBody));
116
+ throw new TelegramError(errorMessage(res.status, errorBody), res.status, errorBody, errorCode(errorBody));
102
117
  }
103
118
  return (await res.json());
104
119
  }
105
120
  catch (error) {
106
- clearTimeout(timeoutId);
107
121
  if (error instanceof TelegramError)
108
122
  throw error;
109
- throw new TelegramError(`Telegram request failed: ${error}`, 500);
123
+ throw new TelegramError("Telegram request failed: " + error, 500);
124
+ }
125
+ finally {
126
+ clearTimeout(timeoutId);
110
127
  }
111
128
  }
112
129
  // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
130
+ // POST https://api.telegram.org/bot{token}/addStickerToSet
131
+ // Docs: https://core.telegram.org/bots/api#addstickertoset
132
+ const addStickerToSet = Object.assign(async (req, signal) => {
133
+ return makeRequest("/addStickerToSet", req ?? {}, signal, TelegramAddStickerToSetRequestSchema);
134
+ }, { schema: TelegramAddStickerToSetRequestSchema });
135
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
136
+ // POST https://api.telegram.org/bot{token}/answerCallbackQuery
137
+ // Docs: https://core.telegram.org/bots/api#answercallbackquery
138
+ const answerCallbackQuery = Object.assign(async (req, signal) => {
139
+ return makeRequest("/answerCallbackQuery", req ?? {}, signal, TelegramAnswerCallbackQueryRequestSchema);
140
+ }, { schema: TelegramAnswerCallbackQueryRequestSchema });
141
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
142
+ // POST https://api.telegram.org/bot{token}/answerChatJoinRequestQuery
143
+ // Docs: https://core.telegram.org/bots/api#answerchatjoinrequestquery
144
+ const answerChatJoinRequestQuery = Object.assign(async (req, signal) => {
145
+ return makeRequest("/answerChatJoinRequestQuery", req ?? {}, signal, TelegramAnswerChatJoinRequestQueryRequestSchema);
146
+ }, { schema: TelegramAnswerChatJoinRequestQueryRequestSchema });
147
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
148
+ // POST https://api.telegram.org/bot{token}/answerGuestQuery
149
+ // Docs: https://core.telegram.org/bots/api#answerguestquery
150
+ const answerGuestQuery = Object.assign(async (req, signal) => {
151
+ return makeRequest("/answerGuestQuery", req ?? {}, signal, TelegramAnswerGuestQueryRequestSchema);
152
+ }, { schema: TelegramAnswerGuestQueryRequestSchema });
153
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
154
+ // POST https://api.telegram.org/bot{token}/answerInlineQuery
155
+ // Docs: https://core.telegram.org/bots/api#answerinlinequery
156
+ const answerInlineQuery = Object.assign(async (req, signal) => {
157
+ return makeRequest("/answerInlineQuery", req ?? {}, signal, TelegramAnswerInlineQueryRequestSchema);
158
+ }, { schema: TelegramAnswerInlineQueryRequestSchema });
159
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
160
+ // POST https://api.telegram.org/bot{token}/answerPreCheckoutQuery
161
+ // Docs: https://core.telegram.org/bots/api#answerprecheckoutquery
162
+ const answerPreCheckoutQuery = Object.assign(async (req, signal) => {
163
+ return makeRequest("/answerPreCheckoutQuery", req ?? {}, signal, TelegramAnswerPreCheckoutQueryRequestSchema);
164
+ }, { schema: TelegramAnswerPreCheckoutQueryRequestSchema });
165
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
166
+ // POST https://api.telegram.org/bot{token}/answerShippingQuery
167
+ // Docs: https://core.telegram.org/bots/api#answershippingquery
168
+ const answerShippingQuery = Object.assign(async (req, signal) => {
169
+ return makeRequest("/answerShippingQuery", req ?? {}, signal, TelegramAnswerShippingQueryRequestSchema);
170
+ }, { schema: TelegramAnswerShippingQueryRequestSchema });
171
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
172
+ // POST https://api.telegram.org/bot{token}/answerWebAppQuery
173
+ // Docs: https://core.telegram.org/bots/api#answerwebappquery
174
+ const answerWebAppQuery = Object.assign(async (req, signal) => {
175
+ return makeRequest("/answerWebAppQuery", req ?? {}, signal, TelegramAnswerWebAppQueryRequestSchema);
176
+ }, { schema: TelegramAnswerWebAppQueryRequestSchema });
177
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
178
+ // POST https://api.telegram.org/bot{token}/approveChatJoinRequest
179
+ // Docs: https://core.telegram.org/bots/api#approvechatjoinrequest
180
+ const approveChatJoinRequest = Object.assign(async (req, signal) => {
181
+ return makeRequest("/approveChatJoinRequest", req ?? {}, signal, TelegramApproveChatJoinRequestRequestSchema);
182
+ }, { schema: TelegramApproveChatJoinRequestRequestSchema });
183
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
184
+ // POST https://api.telegram.org/bot{token}/banChatMember
185
+ // Docs: https://core.telegram.org/bots/api#banchatmember
186
+ const banChatMember = Object.assign(async (req, signal) => {
187
+ return makeRequest("/banChatMember", req ?? {}, signal, TelegramBanChatMemberRequestSchema);
188
+ }, { schema: TelegramBanChatMemberRequestSchema });
189
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
190
+ // POST https://api.telegram.org/bot{token}/banChatSenderChat
191
+ // Docs: https://core.telegram.org/bots/api#banchatsenderchat
192
+ const banChatSenderChat = Object.assign(async (req, signal) => {
193
+ return makeRequest("/banChatSenderChat", req ?? {}, signal, TelegramBanChatSenderChatRequestSchema);
194
+ }, { schema: TelegramBanChatSenderChatRequestSchema });
195
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
196
+ // POST https://api.telegram.org/bot{token}/close
197
+ // Docs: https://core.telegram.org/bots/api#close
198
+ const close = Object.assign(async (req, signal) => {
199
+ return makeRequest("/close", req ?? {}, signal, TelegramCloseRequestSchema);
200
+ }, { schema: TelegramCloseRequestSchema });
201
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
202
+ // POST https://api.telegram.org/bot{token}/closeForumTopic
203
+ // Docs: https://core.telegram.org/bots/api#closeforumtopic
204
+ const closeForumTopic = Object.assign(async (req, signal) => {
205
+ return makeRequest("/closeForumTopic", req ?? {}, signal, TelegramCloseForumTopicRequestSchema);
206
+ }, { schema: TelegramCloseForumTopicRequestSchema });
207
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
208
+ // POST https://api.telegram.org/bot{token}/closeGeneralForumTopic
209
+ // Docs: https://core.telegram.org/bots/api#closegeneralforumtopic
210
+ const closeGeneralForumTopic = Object.assign(async (req, signal) => {
211
+ return makeRequest("/closeGeneralForumTopic", req ?? {}, signal, TelegramCloseGeneralForumTopicRequestSchema);
212
+ }, { schema: TelegramCloseGeneralForumTopicRequestSchema });
213
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
214
+ // POST https://api.telegram.org/bot{token}/convertGiftToStars
215
+ // Docs: https://core.telegram.org/bots/api#convertgifttostars
216
+ const convertGiftToStars = Object.assign(async (req, signal) => {
217
+ return makeRequest("/convertGiftToStars", req ?? {}, signal, TelegramConvertGiftToStarsRequestSchema);
218
+ }, { schema: TelegramConvertGiftToStarsRequestSchema });
219
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
220
+ // POST https://api.telegram.org/bot{token}/copyMessage
221
+ // Docs: https://core.telegram.org/bots/api#copymessage
222
+ const copyMessage = Object.assign(async (req, signal) => {
223
+ return makeRequest("/copyMessage", req ?? {}, signal, TelegramCopyMessageRequestSchema);
224
+ }, { schema: TelegramCopyMessageRequestSchema });
225
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
226
+ // POST https://api.telegram.org/bot{token}/copyMessages
227
+ // Docs: https://core.telegram.org/bots/api#copymessages
228
+ const copyMessages = Object.assign(async (req, signal) => {
229
+ return makeRequest("/copyMessages", req ?? {}, signal, TelegramCopyMessagesRequestSchema);
230
+ }, { schema: TelegramCopyMessagesRequestSchema });
231
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
232
+ // POST https://api.telegram.org/bot{token}/createChatInviteLink
233
+ // Docs: https://core.telegram.org/bots/api#createchatinvitelink
234
+ const createChatInviteLink = Object.assign(async (req, signal) => {
235
+ return makeRequest("/createChatInviteLink", req ?? {}, signal, TelegramCreateChatInviteLinkRequestSchema);
236
+ }, { schema: TelegramCreateChatInviteLinkRequestSchema });
237
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
238
+ // POST https://api.telegram.org/bot{token}/createChatSubscriptionInviteLink
239
+ // Docs: https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
240
+ const createChatSubscriptionInviteLink = Object.assign(async (req, signal) => {
241
+ return makeRequest("/createChatSubscriptionInviteLink", req ?? {}, signal, TelegramCreateChatSubscriptionInviteLinkRequestSchema);
242
+ }, { schema: TelegramCreateChatSubscriptionInviteLinkRequestSchema });
243
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
244
+ // POST https://api.telegram.org/bot{token}/createForumTopic
245
+ // Docs: https://core.telegram.org/bots/api#createforumtopic
246
+ const createForumTopic = Object.assign(async (req, signal) => {
247
+ return makeRequest("/createForumTopic", req ?? {}, signal, TelegramCreateForumTopicRequestSchema);
248
+ }, { schema: TelegramCreateForumTopicRequestSchema });
249
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
250
+ // POST https://api.telegram.org/bot{token}/createInvoiceLink
251
+ // Docs: https://core.telegram.org/bots/api#createinvoicelink
252
+ const createInvoiceLink = Object.assign(async (req, signal) => {
253
+ return makeRequest("/createInvoiceLink", req ?? {}, signal, TelegramCreateInvoiceLinkRequestSchema);
254
+ }, { schema: TelegramCreateInvoiceLinkRequestSchema });
255
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
256
+ // POST https://api.telegram.org/bot{token}/createNewStickerSet
257
+ // Docs: https://core.telegram.org/bots/api#createnewstickerset
258
+ const createNewStickerSet = Object.assign(async (req, signal) => {
259
+ return makeRequest("/createNewStickerSet", req ?? {}, signal, TelegramCreateNewStickerSetRequestSchema);
260
+ }, { schema: TelegramCreateNewStickerSetRequestSchema });
261
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
262
+ // POST https://api.telegram.org/bot{token}/declineChatJoinRequest
263
+ // Docs: https://core.telegram.org/bots/api#declinechatjoinrequest
264
+ const declineChatJoinRequest = Object.assign(async (req, signal) => {
265
+ return makeRequest("/declineChatJoinRequest", req ?? {}, signal, TelegramDeclineChatJoinRequestRequestSchema);
266
+ }, { schema: TelegramDeclineChatJoinRequestRequestSchema });
267
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
268
+ // POST https://api.telegram.org/bot{token}/deleteAllMessageReactions
269
+ // Docs: https://core.telegram.org/bots/api#deleteallmessagereactions
270
+ const deleteAllMessageReactions = Object.assign(async (req, signal) => {
271
+ return makeRequest("/deleteAllMessageReactions", req ?? {}, signal, TelegramDeleteAllMessageReactionsRequestSchema);
272
+ }, { schema: TelegramDeleteAllMessageReactionsRequestSchema });
273
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
274
+ // POST https://api.telegram.org/bot{token}/deleteBusinessMessages
275
+ // Docs: https://core.telegram.org/bots/api#deletebusinessmessages
276
+ const deleteBusinessMessages = Object.assign(async (req, signal) => {
277
+ return makeRequest("/deleteBusinessMessages", req ?? {}, signal, TelegramDeleteBusinessMessagesRequestSchema);
278
+ }, { schema: TelegramDeleteBusinessMessagesRequestSchema });
279
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
280
+ // POST https://api.telegram.org/bot{token}/deleteChatPhoto
281
+ // Docs: https://core.telegram.org/bots/api#deletechatphoto
282
+ const deleteChatPhoto = Object.assign(async (req, signal) => {
283
+ return makeRequest("/deleteChatPhoto", req ?? {}, signal, TelegramDeleteChatPhotoRequestSchema);
284
+ }, { schema: TelegramDeleteChatPhotoRequestSchema });
285
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
286
+ // POST https://api.telegram.org/bot{token}/deleteChatStickerSet
287
+ // Docs: https://core.telegram.org/bots/api#deletechatstickerset
288
+ const deleteChatStickerSet = Object.assign(async (req, signal) => {
289
+ return makeRequest("/deleteChatStickerSet", req ?? {}, signal, TelegramDeleteChatStickerSetRequestSchema);
290
+ }, { schema: TelegramDeleteChatStickerSetRequestSchema });
291
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
292
+ // POST https://api.telegram.org/bot{token}/deleteForumTopic
293
+ // Docs: https://core.telegram.org/bots/api#deleteforumtopic
294
+ const deleteForumTopic = Object.assign(async (req, signal) => {
295
+ return makeRequest("/deleteForumTopic", req ?? {}, signal, TelegramDeleteForumTopicRequestSchema);
296
+ }, { schema: TelegramDeleteForumTopicRequestSchema });
297
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
298
+ // POST https://api.telegram.org/bot{token}/deleteMessage
299
+ // Docs: https://core.telegram.org/bots/api#deletemessage
300
+ const deleteMessage = Object.assign(async (req, signal) => {
301
+ return makeRequest("/deleteMessage", req ?? {}, signal, TelegramDeleteMessageRequestSchema);
302
+ }, { schema: TelegramDeleteMessageRequestSchema });
303
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
304
+ // POST https://api.telegram.org/bot{token}/deleteMessageReaction
305
+ // Docs: https://core.telegram.org/bots/api#deletemessagereaction
306
+ const deleteMessageReaction = Object.assign(async (req, signal) => {
307
+ return makeRequest("/deleteMessageReaction", req ?? {}, signal, TelegramDeleteMessageReactionRequestSchema);
308
+ }, { schema: TelegramDeleteMessageReactionRequestSchema });
309
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
310
+ // POST https://api.telegram.org/bot{token}/deleteMessages
311
+ // Docs: https://core.telegram.org/bots/api#deletemessages
312
+ const deleteMessages = Object.assign(async (req, signal) => {
313
+ return makeRequest("/deleteMessages", req ?? {}, signal, TelegramDeleteMessagesRequestSchema);
314
+ }, { schema: TelegramDeleteMessagesRequestSchema });
315
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
316
+ // POST https://api.telegram.org/bot{token}/deleteMyCommands
317
+ // Docs: https://core.telegram.org/bots/api#deletemycommands
318
+ const deleteMyCommands = Object.assign(async (req, signal) => {
319
+ return makeRequest("/deleteMyCommands", req ?? {}, signal, TelegramDeleteMyCommandsRequestSchema);
320
+ }, { schema: TelegramDeleteMyCommandsRequestSchema });
321
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
322
+ // POST https://api.telegram.org/bot{token}/deleteStickerFromSet
323
+ // Docs: https://core.telegram.org/bots/api#deletestickerfromset
324
+ const deleteStickerFromSet = Object.assign(async (req, signal) => {
325
+ return makeRequest("/deleteStickerFromSet", req ?? {}, signal, TelegramDeleteStickerFromSetRequestSchema);
326
+ }, { schema: TelegramDeleteStickerFromSetRequestSchema });
327
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
328
+ // POST https://api.telegram.org/bot{token}/deleteStickerSet
329
+ // Docs: https://core.telegram.org/bots/api#deletestickerset
330
+ const deleteStickerSet = Object.assign(async (req, signal) => {
331
+ return makeRequest("/deleteStickerSet", req ?? {}, signal, TelegramDeleteStickerSetRequestSchema);
332
+ }, { schema: TelegramDeleteStickerSetRequestSchema });
333
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
334
+ // POST https://api.telegram.org/bot{token}/deleteStory
335
+ // Docs: https://core.telegram.org/bots/api#deletestory
336
+ const deleteStory = Object.assign(async (req, signal) => {
337
+ return makeRequest("/deleteStory", req ?? {}, signal, TelegramDeleteStoryRequestSchema);
338
+ }, { schema: TelegramDeleteStoryRequestSchema });
339
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
340
+ // POST https://api.telegram.org/bot{token}/deleteWebhook
341
+ // Docs: https://core.telegram.org/bots/api#deletewebhook
342
+ const deleteWebhook = Object.assign(async (req, signal) => {
343
+ return makeRequest("/deleteWebhook", req ?? {}, signal, TelegramDeleteWebhookRequestSchema);
344
+ }, { schema: TelegramDeleteWebhookRequestSchema });
345
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
346
+ // POST https://api.telegram.org/bot{token}/editChatInviteLink
347
+ // Docs: https://core.telegram.org/bots/api#editchatinvitelink
348
+ const editChatInviteLink = Object.assign(async (req, signal) => {
349
+ return makeRequest("/editChatInviteLink", req ?? {}, signal, TelegramEditChatInviteLinkRequestSchema);
350
+ }, { schema: TelegramEditChatInviteLinkRequestSchema });
351
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
352
+ // POST https://api.telegram.org/bot{token}/editChatSubscriptionInviteLink
353
+ // Docs: https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
354
+ const editChatSubscriptionInviteLink = Object.assign(async (req, signal) => {
355
+ return makeRequest("/editChatSubscriptionInviteLink", req ?? {}, signal, TelegramEditChatSubscriptionInviteLinkRequestSchema);
356
+ }, { schema: TelegramEditChatSubscriptionInviteLinkRequestSchema });
357
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
358
+ // POST https://api.telegram.org/bot{token}/editForumTopic
359
+ // Docs: https://core.telegram.org/bots/api#editforumtopic
360
+ const editForumTopic = Object.assign(async (req, signal) => {
361
+ return makeRequest("/editForumTopic", req ?? {}, signal, TelegramEditForumTopicRequestSchema);
362
+ }, { schema: TelegramEditForumTopicRequestSchema });
363
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
364
+ // POST https://api.telegram.org/bot{token}/editGeneralForumTopic
365
+ // Docs: https://core.telegram.org/bots/api#editgeneralforumtopic
366
+ const editGeneralForumTopic = Object.assign(async (req, signal) => {
367
+ return makeRequest("/editGeneralForumTopic", req ?? {}, signal, TelegramEditGeneralForumTopicRequestSchema);
368
+ }, { schema: TelegramEditGeneralForumTopicRequestSchema });
369
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
370
+ // POST https://api.telegram.org/bot{token}/editMessageCaption
371
+ // Docs: https://core.telegram.org/bots/api#editmessagecaption
372
+ const editMessageCaption = Object.assign(async (req, signal) => {
373
+ return makeRequest("/editMessageCaption", req ?? {}, signal, TelegramEditMessageCaptionRequestSchema);
374
+ }, { schema: TelegramEditMessageCaptionRequestSchema });
375
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
376
+ // POST https://api.telegram.org/bot{token}/editMessageChecklist
377
+ // Docs: https://core.telegram.org/bots/api#editmessagechecklist
378
+ const editMessageChecklist = Object.assign(async (req, signal) => {
379
+ return makeRequest("/editMessageChecklist", req ?? {}, signal, TelegramEditMessageChecklistRequestSchema);
380
+ }, { schema: TelegramEditMessageChecklistRequestSchema });
381
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
382
+ // POST https://api.telegram.org/bot{token}/editMessageLiveLocation
383
+ // Docs: https://core.telegram.org/bots/api#editmessagelivelocation
384
+ const editMessageLiveLocation = Object.assign(async (req, signal) => {
385
+ return makeRequest("/editMessageLiveLocation", req ?? {}, signal, TelegramEditMessageLiveLocationRequestSchema);
386
+ }, { schema: TelegramEditMessageLiveLocationRequestSchema });
387
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
388
+ // POST https://api.telegram.org/bot{token}/editMessageMedia
389
+ // Docs: https://core.telegram.org/bots/api#editmessagemedia
390
+ const editMessageMedia = Object.assign(async (req, signal) => {
391
+ return makeRequest("/editMessageMedia", req ?? {}, signal, TelegramEditMessageMediaRequestSchema);
392
+ }, { schema: TelegramEditMessageMediaRequestSchema });
393
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
394
+ // POST https://api.telegram.org/bot{token}/editMessageReplyMarkup
395
+ // Docs: https://core.telegram.org/bots/api#editmessagereplymarkup
396
+ const editMessageReplyMarkup = Object.assign(async (req, signal) => {
397
+ return makeRequest("/editMessageReplyMarkup", req ?? {}, signal, TelegramEditMessageReplyMarkupRequestSchema);
398
+ }, { schema: TelegramEditMessageReplyMarkupRequestSchema });
399
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
400
+ // POST https://api.telegram.org/bot{token}/editMessageText
401
+ // Docs: https://core.telegram.org/bots/api#editmessagetext
402
+ const editMessageText = Object.assign(async (req, signal) => {
403
+ return makeRequest("/editMessageText", req ?? {}, signal, TelegramEditMessageTextRequestSchema);
404
+ }, { schema: TelegramEditMessageTextRequestSchema });
405
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
406
+ // POST https://api.telegram.org/bot{token}/editStory
407
+ // Docs: https://core.telegram.org/bots/api#editstory
408
+ const editStory = Object.assign(async (req, signal) => {
409
+ return makeRequest("/editStory", req ?? {}, signal, TelegramEditStoryRequestSchema);
410
+ }, { schema: TelegramEditStoryRequestSchema });
411
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
412
+ // POST https://api.telegram.org/bot{token}/editUserStarSubscription
413
+ // Docs: https://core.telegram.org/bots/api#edituserstarsubscription
414
+ const editUserStarSubscription = Object.assign(async (req, signal) => {
415
+ return makeRequest("/editUserStarSubscription", req ?? {}, signal, TelegramEditUserStarSubscriptionRequestSchema);
416
+ }, { schema: TelegramEditUserStarSubscriptionRequestSchema });
417
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
418
+ // POST https://api.telegram.org/bot{token}/exportChatInviteLink
419
+ // Docs: https://core.telegram.org/bots/api#exportchatinvitelink
420
+ const exportChatInviteLink = Object.assign(async (req, signal) => {
421
+ return makeRequest("/exportChatInviteLink", req ?? {}, signal, TelegramExportChatInviteLinkRequestSchema);
422
+ }, { schema: TelegramExportChatInviteLinkRequestSchema });
423
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
424
+ // POST https://api.telegram.org/bot{token}/forwardMessage
425
+ // Docs: https://core.telegram.org/bots/api#forwardmessage
426
+ const forwardMessage = Object.assign(async (req, signal) => {
427
+ return makeRequest("/forwardMessage", req ?? {}, signal, TelegramForwardMessageRequestSchema);
428
+ }, { schema: TelegramForwardMessageRequestSchema });
429
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
430
+ // POST https://api.telegram.org/bot{token}/forwardMessages
431
+ // Docs: https://core.telegram.org/bots/api#forwardmessages
432
+ const forwardMessages = Object.assign(async (req, signal) => {
433
+ return makeRequest("/forwardMessages", req ?? {}, signal, TelegramForwardMessagesRequestSchema);
434
+ }, { schema: TelegramForwardMessagesRequestSchema });
435
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
436
+ // POST https://api.telegram.org/bot{token}/getAvailableGifts
437
+ // Docs: https://core.telegram.org/bots/api#getavailablegifts
438
+ const getAvailableGifts = Object.assign(async (req, signal) => {
439
+ return makeRequest("/getAvailableGifts", req ?? {}, signal, TelegramGetAvailableGiftsRequestSchema);
440
+ }, { schema: TelegramGetAvailableGiftsRequestSchema });
441
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
442
+ // POST https://api.telegram.org/bot{token}/getBusinessAccountGifts
443
+ // Docs: https://core.telegram.org/bots/api#getbusinessaccountgifts
444
+ const getBusinessAccountGifts = Object.assign(async (req, signal) => {
445
+ return makeRequest("/getBusinessAccountGifts", req ?? {}, signal, TelegramGetBusinessAccountGiftsRequestSchema);
446
+ }, { schema: TelegramGetBusinessAccountGiftsRequestSchema });
447
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
448
+ // POST https://api.telegram.org/bot{token}/getBusinessAccountStarBalance
449
+ // Docs: https://core.telegram.org/bots/api#getbusinessaccountstarbalance
450
+ const getBusinessAccountStarBalance = Object.assign(async (req, signal) => {
451
+ return makeRequest("/getBusinessAccountStarBalance", req ?? {}, signal, TelegramGetBusinessAccountStarBalanceRequestSchema);
452
+ }, { schema: TelegramGetBusinessAccountStarBalanceRequestSchema });
453
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
454
+ // POST https://api.telegram.org/bot{token}/getBusinessConnection
455
+ // Docs: https://core.telegram.org/bots/api#getbusinessconnection
456
+ const getBusinessConnection = Object.assign(async (req, signal) => {
457
+ return makeRequest("/getBusinessConnection", req ?? {}, signal, TelegramGetBusinessConnectionRequestSchema);
458
+ }, { schema: TelegramGetBusinessConnectionRequestSchema });
459
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
460
+ // POST https://api.telegram.org/bot{token}/getChat
461
+ // Docs: https://core.telegram.org/bots/api#getchat
462
+ const getChat = Object.assign(async (req, signal) => {
463
+ return makeRequest("/getChat", req ?? {}, signal, TelegramGetChatRequestSchema);
464
+ }, { schema: TelegramGetChatRequestSchema });
465
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
466
+ // POST https://api.telegram.org/bot{token}/getChatAdministrators
467
+ // Docs: https://core.telegram.org/bots/api#getchatadministrators
468
+ const getChatAdministrators = Object.assign(async (req, signal) => {
469
+ return makeRequest("/getChatAdministrators", req ?? {}, signal, TelegramGetChatAdministratorsRequestSchema);
470
+ }, { schema: TelegramGetChatAdministratorsRequestSchema });
471
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
472
+ // POST https://api.telegram.org/bot{token}/getChatGifts
473
+ // Docs: https://core.telegram.org/bots/api#getchatgifts
474
+ const getChatGifts = Object.assign(async (req, signal) => {
475
+ return makeRequest("/getChatGifts", req ?? {}, signal, TelegramGetChatGiftsRequestSchema);
476
+ }, { schema: TelegramGetChatGiftsRequestSchema });
477
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
478
+ // POST https://api.telegram.org/bot{token}/getChatMember
479
+ // Docs: https://core.telegram.org/bots/api#getchatmember
480
+ const getChatMember = Object.assign(async (req, signal) => {
481
+ return makeRequest("/getChatMember", req ?? {}, signal, TelegramGetChatMemberRequestSchema);
482
+ }, { schema: TelegramGetChatMemberRequestSchema });
483
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
484
+ // POST https://api.telegram.org/bot{token}/getChatMemberCount
485
+ // Docs: https://core.telegram.org/bots/api#getchatmembercount
486
+ const getChatMemberCount = Object.assign(async (req, signal) => {
487
+ return makeRequest("/getChatMemberCount", req ?? {}, signal, TelegramGetChatMemberCountRequestSchema);
488
+ }, { schema: TelegramGetChatMemberCountRequestSchema });
489
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
490
+ // POST https://api.telegram.org/bot{token}/getChatMenuButton
491
+ // Docs: https://core.telegram.org/bots/api#getchatmenubutton
492
+ const getChatMenuButton = Object.assign(async (req, signal) => {
493
+ return makeRequest("/getChatMenuButton", req ?? {}, signal, TelegramGetChatMenuButtonRequestSchema);
494
+ }, { schema: TelegramGetChatMenuButtonRequestSchema });
495
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
496
+ // POST https://api.telegram.org/bot{token}/getCustomEmojiStickers
497
+ // Docs: https://core.telegram.org/bots/api#getcustomemojistickers
498
+ const getCustomEmojiStickers = Object.assign(async (req, signal) => {
499
+ return makeRequest("/getCustomEmojiStickers", req ?? {}, signal, TelegramGetCustomEmojiStickersRequestSchema);
500
+ }, { schema: TelegramGetCustomEmojiStickersRequestSchema });
501
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
502
+ // POST https://api.telegram.org/bot{token}/getFile
503
+ // Docs: https://core.telegram.org/bots/api#getfile
504
+ const getFile = Object.assign(async (req, signal) => {
505
+ return makeRequest("/getFile", req ?? {}, signal, TelegramGetFileRequestSchema);
506
+ }, { schema: TelegramGetFileRequestSchema });
507
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
508
+ // POST https://api.telegram.org/bot{token}/getForumTopicIconStickers
509
+ // Docs: https://core.telegram.org/bots/api#getforumtopiciconstickers
510
+ const getForumTopicIconStickers = Object.assign(async (req, signal) => {
511
+ return makeRequest("/getForumTopicIconStickers", req ?? {}, signal, TelegramGetForumTopicIconStickersRequestSchema);
512
+ }, { schema: TelegramGetForumTopicIconStickersRequestSchema });
513
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
514
+ // POST https://api.telegram.org/bot{token}/getGameHighScores
515
+ // Docs: https://core.telegram.org/bots/api#getgamehighscores
516
+ const getGameHighScores = Object.assign(async (req, signal) => {
517
+ return makeRequest("/getGameHighScores", req ?? {}, signal, TelegramGetGameHighScoresRequestSchema);
518
+ }, { schema: TelegramGetGameHighScoresRequestSchema });
519
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
520
+ // POST https://api.telegram.org/bot{token}/getManagedBotAccessSettings
521
+ // Docs: https://core.telegram.org/bots/api#getmanagedbotaccesssettings
522
+ const getManagedBotAccessSettings = Object.assign(async (req, signal) => {
523
+ return makeRequest("/getManagedBotAccessSettings", req ?? {}, signal, TelegramGetManagedBotAccessSettingsRequestSchema);
524
+ }, { schema: TelegramGetManagedBotAccessSettingsRequestSchema });
525
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
526
+ // POST https://api.telegram.org/bot{token}/getManagedBotToken
527
+ // Docs: https://core.telegram.org/bots/api#getmanagedbottoken
528
+ const getManagedBotToken = Object.assign(async (req, signal) => {
529
+ return makeRequest("/getManagedBotToken", req ?? {}, signal, TelegramGetManagedBotTokenRequestSchema);
530
+ }, { schema: TelegramGetManagedBotTokenRequestSchema });
531
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
532
+ // POST https://api.telegram.org/bot{token}/getMe
533
+ // Docs: https://core.telegram.org/bots/api#getme
534
+ const getMe = Object.assign(async (req, signal) => {
535
+ return makeRequest("/getMe", req ?? {}, signal, TelegramGetMeRequestSchema);
536
+ }, { schema: TelegramGetMeRequestSchema });
537
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
538
+ // POST https://api.telegram.org/bot{token}/getMyCommands
539
+ // Docs: https://core.telegram.org/bots/api#getmycommands
540
+ const getMyCommands = Object.assign(async (req, signal) => {
541
+ return makeRequest("/getMyCommands", req ?? {}, signal, TelegramGetMyCommandsRequestSchema);
542
+ }, { schema: TelegramGetMyCommandsRequestSchema });
543
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
544
+ // POST https://api.telegram.org/bot{token}/getMyDefaultAdministratorRights
545
+ // Docs: https://core.telegram.org/bots/api#getmydefaultadministratorrights
546
+ const getMyDefaultAdministratorRights = Object.assign(async (req, signal) => {
547
+ return makeRequest("/getMyDefaultAdministratorRights", req ?? {}, signal, TelegramGetMyDefaultAdministratorRightsRequestSchema);
548
+ }, { schema: TelegramGetMyDefaultAdministratorRightsRequestSchema });
549
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
550
+ // POST https://api.telegram.org/bot{token}/getMyDescription
551
+ // Docs: https://core.telegram.org/bots/api#getmydescription
552
+ const getMyDescription = Object.assign(async (req, signal) => {
553
+ return makeRequest("/getMyDescription", req ?? {}, signal, TelegramGetMyDescriptionRequestSchema);
554
+ }, { schema: TelegramGetMyDescriptionRequestSchema });
555
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
556
+ // POST https://api.telegram.org/bot{token}/getMyName
557
+ // Docs: https://core.telegram.org/bots/api#getmyname
558
+ const getMyName = Object.assign(async (req, signal) => {
559
+ return makeRequest("/getMyName", req ?? {}, signal, TelegramGetMyNameRequestSchema);
560
+ }, { schema: TelegramGetMyNameRequestSchema });
561
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
562
+ // POST https://api.telegram.org/bot{token}/getMyShortDescription
563
+ // Docs: https://core.telegram.org/bots/api#getmyshortdescription
564
+ const getMyShortDescription = Object.assign(async (req, signal) => {
565
+ return makeRequest("/getMyShortDescription", req ?? {}, signal, TelegramGetMyShortDescriptionRequestSchema);
566
+ }, { schema: TelegramGetMyShortDescriptionRequestSchema });
567
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
568
+ // POST https://api.telegram.org/bot{token}/getMyStarBalance
569
+ // Docs: https://core.telegram.org/bots/api#getmystarbalance
570
+ const getMyStarBalance = Object.assign(async (req, signal) => {
571
+ return makeRequest("/getMyStarBalance", req ?? {}, signal, TelegramGetMyStarBalanceRequestSchema);
572
+ }, { schema: TelegramGetMyStarBalanceRequestSchema });
573
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
574
+ // POST https://api.telegram.org/bot{token}/getStarTransactions
575
+ // Docs: https://core.telegram.org/bots/api#getstartransactions
576
+ const getStarTransactions = Object.assign(async (req, signal) => {
577
+ return makeRequest("/getStarTransactions", req ?? {}, signal, TelegramGetStarTransactionsRequestSchema);
578
+ }, { schema: TelegramGetStarTransactionsRequestSchema });
579
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
580
+ // POST https://api.telegram.org/bot{token}/getStickerSet
581
+ // Docs: https://core.telegram.org/bots/api#getstickerset
582
+ const getStickerSet = Object.assign(async (req, signal) => {
583
+ return makeRequest("/getStickerSet", req ?? {}, signal, TelegramGetStickerSetRequestSchema);
584
+ }, { schema: TelegramGetStickerSetRequestSchema });
585
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
586
+ // POST https://api.telegram.org/bot{token}/getUpdates
587
+ // Docs: https://core.telegram.org/bots/api#getupdates
588
+ const getUpdates = Object.assign(async (req, signal) => {
589
+ return makeRequest("/getUpdates", req ?? {}, signal, TelegramGetUpdatesRequestSchema);
590
+ }, { schema: TelegramGetUpdatesRequestSchema });
591
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
592
+ // POST https://api.telegram.org/bot{token}/getUserChatBoosts
593
+ // Docs: https://core.telegram.org/bots/api#getuserchatboosts
594
+ const getUserChatBoosts = Object.assign(async (req, signal) => {
595
+ return makeRequest("/getUserChatBoosts", req ?? {}, signal, TelegramGetUserChatBoostsRequestSchema);
596
+ }, { schema: TelegramGetUserChatBoostsRequestSchema });
597
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
598
+ // POST https://api.telegram.org/bot{token}/getUserGifts
599
+ // Docs: https://core.telegram.org/bots/api#getusergifts
600
+ const getUserGifts = Object.assign(async (req, signal) => {
601
+ return makeRequest("/getUserGifts", req ?? {}, signal, TelegramGetUserGiftsRequestSchema);
602
+ }, { schema: TelegramGetUserGiftsRequestSchema });
603
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
604
+ // POST https://api.telegram.org/bot{token}/getUserPersonalChatMessages
605
+ // Docs: https://core.telegram.org/bots/api#getuserpersonalchatmessages
606
+ const getUserPersonalChatMessages = Object.assign(async (req, signal) => {
607
+ return makeRequest("/getUserPersonalChatMessages", req ?? {}, signal, TelegramGetUserPersonalChatMessagesRequestSchema);
608
+ }, { schema: TelegramGetUserPersonalChatMessagesRequestSchema });
609
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
610
+ // POST https://api.telegram.org/bot{token}/getWebhookInfo
611
+ // Docs: https://core.telegram.org/bots/api#getwebhookinfo
612
+ const getWebhookInfo = Object.assign(async (req, signal) => {
613
+ return makeRequest("/getWebhookInfo", req ?? {}, signal, TelegramGetWebhookInfoRequestSchema);
614
+ }, { schema: TelegramGetWebhookInfoRequestSchema });
615
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
616
+ // POST https://api.telegram.org/bot{token}/giftPremiumSubscription
617
+ // Docs: https://core.telegram.org/bots/api#giftpremiumsubscription
618
+ const giftPremiumSubscription = Object.assign(async (req, signal) => {
619
+ return makeRequest("/giftPremiumSubscription", req ?? {}, signal, TelegramGiftPremiumSubscriptionRequestSchema);
620
+ }, { schema: TelegramGiftPremiumSubscriptionRequestSchema });
621
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
622
+ // POST https://api.telegram.org/bot{token}/hideGeneralForumTopic
623
+ // Docs: https://core.telegram.org/bots/api#hidegeneralforumtopic
624
+ const hideGeneralForumTopic = Object.assign(async (req, signal) => {
625
+ return makeRequest("/hideGeneralForumTopic", req ?? {}, signal, TelegramHideGeneralForumTopicRequestSchema);
626
+ }, { schema: TelegramHideGeneralForumTopicRequestSchema });
627
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
628
+ // POST https://api.telegram.org/bot{token}/leaveChat
629
+ // Docs: https://core.telegram.org/bots/api#leavechat
630
+ const leaveChat = Object.assign(async (req, signal) => {
631
+ return makeRequest("/leaveChat", req ?? {}, signal, TelegramLeaveChatRequestSchema);
632
+ }, { schema: TelegramLeaveChatRequestSchema });
633
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
634
+ // POST https://api.telegram.org/bot{token}/logOut
635
+ // Docs: https://core.telegram.org/bots/api#logout
636
+ const logOut = Object.assign(async (req, signal) => {
637
+ return makeRequest("/logOut", req ?? {}, signal, TelegramLogOutRequestSchema);
638
+ }, { schema: TelegramLogOutRequestSchema });
639
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
640
+ // POST https://api.telegram.org/bot{token}/pinChatMessage
641
+ // Docs: https://core.telegram.org/bots/api#pinchatmessage
642
+ const pinChatMessage = Object.assign(async (req, signal) => {
643
+ return makeRequest("/pinChatMessage", req ?? {}, signal, TelegramPinChatMessageRequestSchema);
644
+ }, { schema: TelegramPinChatMessageRequestSchema });
645
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
646
+ // POST https://api.telegram.org/bot{token}/postStory
647
+ // Docs: https://core.telegram.org/bots/api#poststory
648
+ const postStory = Object.assign(async (req, signal) => {
649
+ return makeRequest("/postStory", req ?? {}, signal, TelegramPostStoryRequestSchema);
650
+ }, { schema: TelegramPostStoryRequestSchema });
651
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
652
+ // POST https://api.telegram.org/bot{token}/promoteChatMember
653
+ // Docs: https://core.telegram.org/bots/api#promotechatmember
654
+ const promoteChatMember = Object.assign(async (req, signal) => {
655
+ return makeRequest("/promoteChatMember", req ?? {}, signal, TelegramPromoteChatMemberRequestSchema);
656
+ }, { schema: TelegramPromoteChatMemberRequestSchema });
657
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
658
+ // POST https://api.telegram.org/bot{token}/readBusinessMessage
659
+ // Docs: https://core.telegram.org/bots/api#readbusinessmessage
660
+ const readBusinessMessage = Object.assign(async (req, signal) => {
661
+ return makeRequest("/readBusinessMessage", req ?? {}, signal, TelegramReadBusinessMessageRequestSchema);
662
+ }, { schema: TelegramReadBusinessMessageRequestSchema });
663
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
664
+ // POST https://api.telegram.org/bot{token}/refundStarPayment
665
+ // Docs: https://core.telegram.org/bots/api#refundstarpayment
666
+ const refundStarPayment = Object.assign(async (req, signal) => {
667
+ return makeRequest("/refundStarPayment", req ?? {}, signal, TelegramRefundStarPaymentRequestSchema);
668
+ }, { schema: TelegramRefundStarPaymentRequestSchema });
669
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
670
+ // POST https://api.telegram.org/bot{token}/removeBusinessAccountProfilePhoto
671
+ // Docs: https://core.telegram.org/bots/api#removebusinessaccountprofilephoto
672
+ const removeBusinessAccountProfilePhoto = Object.assign(async (req, signal) => {
673
+ return makeRequest("/removeBusinessAccountProfilePhoto", req ?? {}, signal, TelegramRemoveBusinessAccountProfilePhotoRequestSchema);
674
+ }, { schema: TelegramRemoveBusinessAccountProfilePhotoRequestSchema });
675
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
676
+ // POST https://api.telegram.org/bot{token}/removeChatVerification
677
+ // Docs: https://core.telegram.org/bots/api#removechatverification
678
+ const removeChatVerification = Object.assign(async (req, signal) => {
679
+ return makeRequest("/removeChatVerification", req ?? {}, signal, TelegramRemoveChatVerificationRequestSchema);
680
+ }, { schema: TelegramRemoveChatVerificationRequestSchema });
681
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
682
+ // POST https://api.telegram.org/bot{token}/removeUserVerification
683
+ // Docs: https://core.telegram.org/bots/api#removeuserverification
684
+ const removeUserVerification = Object.assign(async (req, signal) => {
685
+ return makeRequest("/removeUserVerification", req ?? {}, signal, TelegramRemoveUserVerificationRequestSchema);
686
+ }, { schema: TelegramRemoveUserVerificationRequestSchema });
687
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
688
+ // POST https://api.telegram.org/bot{token}/reopenForumTopic
689
+ // Docs: https://core.telegram.org/bots/api#reopenforumtopic
690
+ const reopenForumTopic = Object.assign(async (req, signal) => {
691
+ return makeRequest("/reopenForumTopic", req ?? {}, signal, TelegramReopenForumTopicRequestSchema);
692
+ }, { schema: TelegramReopenForumTopicRequestSchema });
693
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
694
+ // POST https://api.telegram.org/bot{token}/reopenGeneralForumTopic
695
+ // Docs: https://core.telegram.org/bots/api#reopengeneralforumtopic
696
+ const reopenGeneralForumTopic = Object.assign(async (req, signal) => {
697
+ return makeRequest("/reopenGeneralForumTopic", req ?? {}, signal, TelegramReopenGeneralForumTopicRequestSchema);
698
+ }, { schema: TelegramReopenGeneralForumTopicRequestSchema });
699
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
700
+ // POST https://api.telegram.org/bot{token}/replaceManagedBotToken
701
+ // Docs: https://core.telegram.org/bots/api#replacemanagedbottoken
702
+ const replaceManagedBotToken = Object.assign(async (req, signal) => {
703
+ return makeRequest("/replaceManagedBotToken", req ?? {}, signal, TelegramReplaceManagedBotTokenRequestSchema);
704
+ }, { schema: TelegramReplaceManagedBotTokenRequestSchema });
705
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
706
+ // POST https://api.telegram.org/bot{token}/replaceStickerInSet
707
+ // Docs: https://core.telegram.org/bots/api#replacestickerinset
708
+ const replaceStickerInSet = Object.assign(async (req, signal) => {
709
+ return makeRequest("/replaceStickerInSet", req ?? {}, signal, TelegramReplaceStickerInSetRequestSchema);
710
+ }, { schema: TelegramReplaceStickerInSetRequestSchema });
711
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
712
+ // POST https://api.telegram.org/bot{token}/repostStory
713
+ // Docs: https://core.telegram.org/bots/api#repoststory
714
+ const repostStory = Object.assign(async (req, signal) => {
715
+ return makeRequest("/repostStory", req ?? {}, signal, TelegramRepostStoryRequestSchema);
716
+ }, { schema: TelegramRepostStoryRequestSchema });
717
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
718
+ // POST https://api.telegram.org/bot{token}/restrictChatMember
719
+ // Docs: https://core.telegram.org/bots/api#restrictchatmember
720
+ const restrictChatMember = Object.assign(async (req, signal) => {
721
+ return makeRequest("/restrictChatMember", req ?? {}, signal, TelegramRestrictChatMemberRequestSchema);
722
+ }, { schema: TelegramRestrictChatMemberRequestSchema });
723
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
724
+ // POST https://api.telegram.org/bot{token}/revokeChatInviteLink
725
+ // Docs: https://core.telegram.org/bots/api#revokechatinvitelink
726
+ const revokeChatInviteLink = Object.assign(async (req, signal) => {
727
+ return makeRequest("/revokeChatInviteLink", req ?? {}, signal, TelegramRevokeChatInviteLinkRequestSchema);
728
+ }, { schema: TelegramRevokeChatInviteLinkRequestSchema });
729
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
730
+ // POST https://api.telegram.org/bot{token}/savePreparedInlineMessage
731
+ // Docs: https://core.telegram.org/bots/api#savepreparedinlinemessage
732
+ const savePreparedInlineMessage = Object.assign(async (req, signal) => {
733
+ return makeRequest("/savePreparedInlineMessage", req ?? {}, signal, TelegramSavePreparedInlineMessageRequestSchema);
734
+ }, { schema: TelegramSavePreparedInlineMessageRequestSchema });
735
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
736
+ // POST https://api.telegram.org/bot{token}/savePreparedKeyboardButton
737
+ // Docs: https://core.telegram.org/bots/api#savepreparedkeyboardbutton
738
+ const savePreparedKeyboardButton = Object.assign(async (req, signal) => {
739
+ return makeRequest("/savePreparedKeyboardButton", req ?? {}, signal, TelegramSavePreparedKeyboardButtonRequestSchema);
740
+ }, { schema: TelegramSavePreparedKeyboardButtonRequestSchema });
741
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
742
+ // POST https://api.telegram.org/bot{token}/sendAnimation
743
+ // Docs: https://core.telegram.org/bots/api#sendanimation
744
+ const sendAnimation = Object.assign(async (req, signal) => {
745
+ return makeRequest("/sendAnimation", req ?? {}, signal, TelegramSendAnimationRequestSchema);
746
+ }, { schema: TelegramSendAnimationRequestSchema });
747
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
748
+ // POST https://api.telegram.org/bot{token}/sendAudio
749
+ // Docs: https://core.telegram.org/bots/api#sendaudio
750
+ const sendAudio = Object.assign(async (req, signal) => {
751
+ return makeRequest("/sendAudio", req ?? {}, signal, TelegramSendAudioRequestSchema);
752
+ }, { schema: TelegramSendAudioRequestSchema });
753
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
754
+ // POST https://api.telegram.org/bot{token}/sendChatAction
755
+ // Docs: https://core.telegram.org/bots/api#sendchataction
756
+ const sendChatAction = Object.assign(async (req, signal) => {
757
+ return makeRequest("/sendChatAction", req ?? {}, signal, TelegramSendChatActionRequestSchema);
758
+ }, { schema: TelegramSendChatActionRequestSchema });
759
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
760
+ // POST https://api.telegram.org/bot{token}/sendChatJoinRequestWebApp
761
+ // Docs: https://core.telegram.org/bots/api#sendchatjoinrequestwebapp
762
+ const sendChatJoinRequestWebApp = Object.assign(async (req, signal) => {
763
+ return makeRequest("/sendChatJoinRequestWebApp", req ?? {}, signal, TelegramSendChatJoinRequestWebAppRequestSchema);
764
+ }, { schema: TelegramSendChatJoinRequestWebAppRequestSchema });
765
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
766
+ // POST https://api.telegram.org/bot{token}/sendChecklist
767
+ // Docs: https://core.telegram.org/bots/api#sendchecklist
768
+ const sendChecklist = Object.assign(async (req, signal) => {
769
+ return makeRequest("/sendChecklist", req ?? {}, signal, TelegramSendChecklistRequestSchema);
770
+ }, { schema: TelegramSendChecklistRequestSchema });
771
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
772
+ // POST https://api.telegram.org/bot{token}/sendContact
773
+ // Docs: https://core.telegram.org/bots/api#sendcontact
774
+ const sendContact = Object.assign(async (req, signal) => {
775
+ return makeRequest("/sendContact", req ?? {}, signal, TelegramSendContactRequestSchema);
776
+ }, { schema: TelegramSendContactRequestSchema });
777
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
778
+ // POST https://api.telegram.org/bot{token}/sendDice
779
+ // Docs: https://core.telegram.org/bots/api#senddice
780
+ const sendDice = Object.assign(async (req, signal) => {
781
+ return makeRequest("/sendDice", req ?? {}, signal, TelegramSendDiceRequestSchema);
782
+ }, { schema: TelegramSendDiceRequestSchema });
783
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
784
+ // POST https://api.telegram.org/bot{token}/sendDocument
785
+ // Docs: https://core.telegram.org/bots/api#senddocument
786
+ const sendDocument = Object.assign(async (req, signal) => {
787
+ return makeRequest("/sendDocument", req ?? {}, signal, TelegramSendDocumentRequestSchema);
788
+ }, { schema: TelegramSendDocumentRequestSchema });
789
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
790
+ // POST https://api.telegram.org/bot{token}/sendGame
791
+ // Docs: https://core.telegram.org/bots/api#sendgame
792
+ const sendGame = Object.assign(async (req, signal) => {
793
+ return makeRequest("/sendGame", req ?? {}, signal, TelegramSendGameRequestSchema);
794
+ }, { schema: TelegramSendGameRequestSchema });
795
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
796
+ // POST https://api.telegram.org/bot{token}/sendGift
797
+ // Docs: https://core.telegram.org/bots/api#sendgift
798
+ const sendGift = Object.assign(async (req, signal) => {
799
+ return makeRequest("/sendGift", req ?? {}, signal, TelegramSendGiftRequestSchema);
800
+ }, { schema: TelegramSendGiftRequestSchema });
801
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
802
+ // POST https://api.telegram.org/bot{token}/sendInvoice
803
+ // Docs: https://core.telegram.org/bots/api#sendinvoice
804
+ const sendInvoice = Object.assign(async (req, signal) => {
805
+ return makeRequest("/sendInvoice", req ?? {}, signal, TelegramSendInvoiceRequestSchema);
806
+ }, { schema: TelegramSendInvoiceRequestSchema });
807
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
808
+ // POST https://api.telegram.org/bot{token}/sendLivePhoto
809
+ // Docs: https://core.telegram.org/bots/api#sendlivephoto
810
+ const sendLivePhoto = Object.assign(async (req, signal) => {
811
+ return makeRequest("/sendLivePhoto", req ?? {}, signal, TelegramSendLivePhotoRequestSchema);
812
+ }, { schema: TelegramSendLivePhotoRequestSchema });
813
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
814
+ // POST https://api.telegram.org/bot{token}/sendLocation
815
+ // Docs: https://core.telegram.org/bots/api#sendlocation
816
+ const sendLocation = Object.assign(async (req, signal) => {
817
+ return makeRequest("/sendLocation", req ?? {}, signal, TelegramSendLocationRequestSchema);
818
+ }, { schema: TelegramSendLocationRequestSchema });
819
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
820
+ // POST https://api.telegram.org/bot{token}/sendMediaGroup
821
+ // Docs: https://core.telegram.org/bots/api#sendmediagroup
822
+ const sendMediaGroup = Object.assign(async (req, signal) => {
823
+ return makeRequest("/sendMediaGroup", req ?? {}, signal, TelegramSendMediaGroupRequestSchema);
824
+ }, { schema: TelegramSendMediaGroupRequestSchema });
825
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
113
826
  // POST https://api.telegram.org/bot{token}/sendMessage
114
827
  // Docs: https://core.telegram.org/bots/api#sendmessage
115
828
  const sendMessage = Object.assign(async (req, signal) => {
116
- return makeRequest("/sendMessage", req, signal);
829
+ return makeRequest("/sendMessage", req ?? {}, signal, TelegramSendMessageRequestSchema);
117
830
  }, { schema: TelegramSendMessageRequestSchema });
118
831
  // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
832
+ // POST https://api.telegram.org/bot{token}/sendMessageDraft
833
+ // Docs: https://core.telegram.org/bots/api#sendmessagedraft
834
+ const sendMessageDraft = Object.assign(async (req, signal) => {
835
+ return makeRequest("/sendMessageDraft", req ?? {}, signal, TelegramSendMessageDraftRequestSchema);
836
+ }, { schema: TelegramSendMessageDraftRequestSchema });
837
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
838
+ // POST https://api.telegram.org/bot{token}/sendPaidMedia
839
+ // Docs: https://core.telegram.org/bots/api#sendpaidmedia
840
+ const sendPaidMedia = Object.assign(async (req, signal) => {
841
+ return makeRequest("/sendPaidMedia", req ?? {}, signal, TelegramSendPaidMediaRequestSchema);
842
+ }, { schema: TelegramSendPaidMediaRequestSchema });
843
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
119
844
  // POST https://api.telegram.org/bot{token}/sendPhoto
120
845
  // Docs: https://core.telegram.org/bots/api#sendphoto
121
846
  const sendPhoto = Object.assign(async (req, signal) => {
122
- return makeRequest("/sendPhoto", req, signal);
847
+ return makeRequest("/sendPhoto", req ?? {}, signal, TelegramSendPhotoRequestSchema);
123
848
  }, { schema: TelegramSendPhotoRequestSchema });
124
849
  // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
850
+ // POST https://api.telegram.org/bot{token}/sendPoll
851
+ // Docs: https://core.telegram.org/bots/api#sendpoll
852
+ const sendPoll = Object.assign(async (req, signal) => {
853
+ return makeRequest("/sendPoll", req ?? {}, signal, TelegramSendPollRequestSchema);
854
+ }, { schema: TelegramSendPollRequestSchema });
855
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
856
+ // POST https://api.telegram.org/bot{token}/sendRichMessage
857
+ // Docs: https://core.telegram.org/bots/api#sendrichmessage
858
+ const sendRichMessage = Object.assign(async (req, signal) => {
859
+ return makeRequest("/sendRichMessage", req ?? {}, signal, TelegramSendRichMessageRequestSchema);
860
+ }, { schema: TelegramSendRichMessageRequestSchema });
861
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
862
+ // POST https://api.telegram.org/bot{token}/sendRichMessageDraft
863
+ // Docs: https://core.telegram.org/bots/api#sendrichmessagedraft
864
+ const sendRichMessageDraft = Object.assign(async (req, signal) => {
865
+ return makeRequest("/sendRichMessageDraft", req ?? {}, signal, TelegramSendRichMessageDraftRequestSchema);
866
+ }, { schema: TelegramSendRichMessageDraftRequestSchema });
867
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
868
+ // POST https://api.telegram.org/bot{token}/sendSticker
869
+ // Docs: https://core.telegram.org/bots/api#sendsticker
870
+ const sendSticker = Object.assign(async (req, signal) => {
871
+ return makeRequest("/sendSticker", req ?? {}, signal, TelegramSendStickerRequestSchema);
872
+ }, { schema: TelegramSendStickerRequestSchema });
873
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
874
+ // POST https://api.telegram.org/bot{token}/sendVenue
875
+ // Docs: https://core.telegram.org/bots/api#sendvenue
876
+ const sendVenue = Object.assign(async (req, signal) => {
877
+ return makeRequest("/sendVenue", req ?? {}, signal, TelegramSendVenueRequestSchema);
878
+ }, { schema: TelegramSendVenueRequestSchema });
879
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
125
880
  // POST https://api.telegram.org/bot{token}/sendVideo
126
881
  // Docs: https://core.telegram.org/bots/api#sendvideo
127
882
  const sendVideo = Object.assign(async (req, signal) => {
128
- return makeRequest("/sendVideo", req, signal);
883
+ return makeRequest("/sendVideo", req ?? {}, signal, TelegramSendVideoRequestSchema);
129
884
  }, { schema: TelegramSendVideoRequestSchema });
130
885
  // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
131
- // POST https://api.telegram.org/bot{token}/sendAudio
132
- // Docs: https://core.telegram.org/bots/api#sendaudio
133
- const sendAudio = Object.assign(async (req, signal) => {
134
- return makeRequest("/sendAudio", req, signal);
135
- }, { schema: TelegramSendAudioRequestSchema });
886
+ // POST https://api.telegram.org/bot{token}/sendVideoNote
887
+ // Docs: https://core.telegram.org/bots/api#sendvideonote
888
+ const sendVideoNote = Object.assign(async (req, signal) => {
889
+ return makeRequest("/sendVideoNote", req ?? {}, signal, TelegramSendVideoNoteRequestSchema);
890
+ }, { schema: TelegramSendVideoNoteRequestSchema });
891
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
892
+ // POST https://api.telegram.org/bot{token}/sendVoice
893
+ // Docs: https://core.telegram.org/bots/api#sendvoice
894
+ const sendVoice = Object.assign(async (req, signal) => {
895
+ return makeRequest("/sendVoice", req ?? {}, signal, TelegramSendVoiceRequestSchema);
896
+ }, { schema: TelegramSendVoiceRequestSchema });
897
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
898
+ // POST https://api.telegram.org/bot{token}/setBusinessAccountBio
899
+ // Docs: https://core.telegram.org/bots/api#setbusinessaccountbio
900
+ const setBusinessAccountBio = Object.assign(async (req, signal) => {
901
+ return makeRequest("/setBusinessAccountBio", req ?? {}, signal, TelegramSetBusinessAccountBioRequestSchema);
902
+ }, { schema: TelegramSetBusinessAccountBioRequestSchema });
903
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
904
+ // POST https://api.telegram.org/bot{token}/setBusinessAccountGiftSettings
905
+ // Docs: https://core.telegram.org/bots/api#setbusinessaccountgiftsettings
906
+ const setBusinessAccountGiftSettings = Object.assign(async (req, signal) => {
907
+ return makeRequest("/setBusinessAccountGiftSettings", req ?? {}, signal, TelegramSetBusinessAccountGiftSettingsRequestSchema);
908
+ }, { schema: TelegramSetBusinessAccountGiftSettingsRequestSchema });
909
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
910
+ // POST https://api.telegram.org/bot{token}/setBusinessAccountName
911
+ // Docs: https://core.telegram.org/bots/api#setbusinessaccountname
912
+ const setBusinessAccountName = Object.assign(async (req, signal) => {
913
+ return makeRequest("/setBusinessAccountName", req ?? {}, signal, TelegramSetBusinessAccountNameRequestSchema);
914
+ }, { schema: TelegramSetBusinessAccountNameRequestSchema });
915
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
916
+ // POST https://api.telegram.org/bot{token}/setBusinessAccountProfilePhoto
917
+ // Docs: https://core.telegram.org/bots/api#setbusinessaccountprofilephoto
918
+ const setBusinessAccountProfilePhoto = Object.assign(async (req, signal) => {
919
+ return makeRequest("/setBusinessAccountProfilePhoto", req ?? {}, signal, TelegramSetBusinessAccountProfilePhotoRequestSchema);
920
+ }, { schema: TelegramSetBusinessAccountProfilePhotoRequestSchema });
921
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
922
+ // POST https://api.telegram.org/bot{token}/setBusinessAccountUsername
923
+ // Docs: https://core.telegram.org/bots/api#setbusinessaccountusername
924
+ const setBusinessAccountUsername = Object.assign(async (req, signal) => {
925
+ return makeRequest("/setBusinessAccountUsername", req ?? {}, signal, TelegramSetBusinessAccountUsernameRequestSchema);
926
+ }, { schema: TelegramSetBusinessAccountUsernameRequestSchema });
927
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
928
+ // POST https://api.telegram.org/bot{token}/setChatAdministratorCustomTitle
929
+ // Docs: https://core.telegram.org/bots/api#setchatadministratorcustomtitle
930
+ const setChatAdministratorCustomTitle = Object.assign(async (req, signal) => {
931
+ return makeRequest("/setChatAdministratorCustomTitle", req ?? {}, signal, TelegramSetChatAdministratorCustomTitleRequestSchema);
932
+ }, { schema: TelegramSetChatAdministratorCustomTitleRequestSchema });
933
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
934
+ // POST https://api.telegram.org/bot{token}/setChatDescription
935
+ // Docs: https://core.telegram.org/bots/api#setchatdescription
936
+ const setChatDescription = Object.assign(async (req, signal) => {
937
+ return makeRequest("/setChatDescription", req ?? {}, signal, TelegramSetChatDescriptionRequestSchema);
938
+ }, { schema: TelegramSetChatDescriptionRequestSchema });
939
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
940
+ // POST https://api.telegram.org/bot{token}/setChatMemberTag
941
+ // Docs: https://core.telegram.org/bots/api#setchatmembertag
942
+ const setChatMemberTag = Object.assign(async (req, signal) => {
943
+ return makeRequest("/setChatMemberTag", req ?? {}, signal, TelegramSetChatMemberTagRequestSchema);
944
+ }, { schema: TelegramSetChatMemberTagRequestSchema });
945
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
946
+ // POST https://api.telegram.org/bot{token}/setChatMenuButton
947
+ // Docs: https://core.telegram.org/bots/api#setchatmenubutton
948
+ const setChatMenuButton = Object.assign(async (req, signal) => {
949
+ return makeRequest("/setChatMenuButton", req ?? {}, signal, TelegramSetChatMenuButtonRequestSchema);
950
+ }, { schema: TelegramSetChatMenuButtonRequestSchema });
951
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
952
+ // POST https://api.telegram.org/bot{token}/setChatPermissions
953
+ // Docs: https://core.telegram.org/bots/api#setchatpermissions
954
+ const setChatPermissions = Object.assign(async (req, signal) => {
955
+ return makeRequest("/setChatPermissions", req ?? {}, signal, TelegramSetChatPermissionsRequestSchema);
956
+ }, { schema: TelegramSetChatPermissionsRequestSchema });
957
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
958
+ // POST https://api.telegram.org/bot{token}/setChatPhoto
959
+ // Docs: https://core.telegram.org/bots/api#setchatphoto
960
+ const setChatPhoto = Object.assign(async (req, signal) => {
961
+ return makeRequest("/setChatPhoto", req ?? {}, signal, TelegramSetChatPhotoRequestSchema);
962
+ }, { schema: TelegramSetChatPhotoRequestSchema });
963
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
964
+ // POST https://api.telegram.org/bot{token}/setChatStickerSet
965
+ // Docs: https://core.telegram.org/bots/api#setchatstickerset
966
+ const setChatStickerSet = Object.assign(async (req, signal) => {
967
+ return makeRequest("/setChatStickerSet", req ?? {}, signal, TelegramSetChatStickerSetRequestSchema);
968
+ }, { schema: TelegramSetChatStickerSetRequestSchema });
969
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
970
+ // POST https://api.telegram.org/bot{token}/setChatTitle
971
+ // Docs: https://core.telegram.org/bots/api#setchattitle
972
+ const setChatTitle = Object.assign(async (req, signal) => {
973
+ return makeRequest("/setChatTitle", req ?? {}, signal, TelegramSetChatTitleRequestSchema);
974
+ }, { schema: TelegramSetChatTitleRequestSchema });
975
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
976
+ // POST https://api.telegram.org/bot{token}/setCustomEmojiStickerSetThumbnail
977
+ // Docs: https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
978
+ const setCustomEmojiStickerSetThumbnail = Object.assign(async (req, signal) => {
979
+ return makeRequest("/setCustomEmojiStickerSetThumbnail", req ?? {}, signal, TelegramSetCustomEmojiStickerSetThumbnailRequestSchema);
980
+ }, { schema: TelegramSetCustomEmojiStickerSetThumbnailRequestSchema });
981
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
982
+ // POST https://api.telegram.org/bot{token}/setGameScore
983
+ // Docs: https://core.telegram.org/bots/api#setgamescore
984
+ const setGameScore = Object.assign(async (req, signal) => {
985
+ return makeRequest("/setGameScore", req ?? {}, signal, TelegramSetGameScoreRequestSchema);
986
+ }, { schema: TelegramSetGameScoreRequestSchema });
987
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
988
+ // POST https://api.telegram.org/bot{token}/setManagedBotAccessSettings
989
+ // Docs: https://core.telegram.org/bots/api#setmanagedbotaccesssettings
990
+ const setManagedBotAccessSettings = Object.assign(async (req, signal) => {
991
+ return makeRequest("/setManagedBotAccessSettings", req ?? {}, signal, TelegramSetManagedBotAccessSettingsRequestSchema);
992
+ }, { schema: TelegramSetManagedBotAccessSettingsRequestSchema });
993
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
994
+ // POST https://api.telegram.org/bot{token}/setMessageReaction
995
+ // Docs: https://core.telegram.org/bots/api#setmessagereaction
996
+ const setMessageReaction = Object.assign(async (req, signal) => {
997
+ return makeRequest("/setMessageReaction", req ?? {}, signal, TelegramSetMessageReactionRequestSchema);
998
+ }, { schema: TelegramSetMessageReactionRequestSchema });
999
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1000
+ // POST https://api.telegram.org/bot{token}/setMyCommands
1001
+ // Docs: https://core.telegram.org/bots/api#setmycommands
1002
+ const setMyCommands = Object.assign(async (req, signal) => {
1003
+ return makeRequest("/setMyCommands", req ?? {}, signal, TelegramSetMyCommandsRequestSchema);
1004
+ }, { schema: TelegramSetMyCommandsRequestSchema });
1005
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1006
+ // POST https://api.telegram.org/bot{token}/setMyDefaultAdministratorRights
1007
+ // Docs: https://core.telegram.org/bots/api#setmydefaultadministratorrights
1008
+ const setMyDefaultAdministratorRights = Object.assign(async (req, signal) => {
1009
+ return makeRequest("/setMyDefaultAdministratorRights", req ?? {}, signal, TelegramSetMyDefaultAdministratorRightsRequestSchema);
1010
+ }, { schema: TelegramSetMyDefaultAdministratorRightsRequestSchema });
1011
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1012
+ // POST https://api.telegram.org/bot{token}/setMyDescription
1013
+ // Docs: https://core.telegram.org/bots/api#setmydescription
1014
+ const setMyDescription = Object.assign(async (req, signal) => {
1015
+ return makeRequest("/setMyDescription", req ?? {}, signal, TelegramSetMyDescriptionRequestSchema);
1016
+ }, { schema: TelegramSetMyDescriptionRequestSchema });
1017
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1018
+ // POST https://api.telegram.org/bot{token}/setMyName
1019
+ // Docs: https://core.telegram.org/bots/api#setmyname
1020
+ const setMyName = Object.assign(async (req, signal) => {
1021
+ return makeRequest("/setMyName", req ?? {}, signal, TelegramSetMyNameRequestSchema);
1022
+ }, { schema: TelegramSetMyNameRequestSchema });
1023
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1024
+ // POST https://api.telegram.org/bot{token}/setMyShortDescription
1025
+ // Docs: https://core.telegram.org/bots/api#setmyshortdescription
1026
+ const setMyShortDescription = Object.assign(async (req, signal) => {
1027
+ return makeRequest("/setMyShortDescription", req ?? {}, signal, TelegramSetMyShortDescriptionRequestSchema);
1028
+ }, { schema: TelegramSetMyShortDescriptionRequestSchema });
1029
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1030
+ // POST https://api.telegram.org/bot{token}/setPassportDataErrors
1031
+ // Docs: https://core.telegram.org/bots/api#setpassportdataerrors
1032
+ const setPassportDataErrors = Object.assign(async (req, signal) => {
1033
+ return makeRequest("/setPassportDataErrors", req ?? {}, signal, TelegramSetPassportDataErrorsRequestSchema);
1034
+ }, { schema: TelegramSetPassportDataErrorsRequestSchema });
1035
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1036
+ // POST https://api.telegram.org/bot{token}/setStickerEmojiList
1037
+ // Docs: https://core.telegram.org/bots/api#setstickeremojilist
1038
+ const setStickerEmojiList = Object.assign(async (req, signal) => {
1039
+ return makeRequest("/setStickerEmojiList", req ?? {}, signal, TelegramSetStickerEmojiListRequestSchema);
1040
+ }, { schema: TelegramSetStickerEmojiListRequestSchema });
1041
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1042
+ // POST https://api.telegram.org/bot{token}/setStickerKeywords
1043
+ // Docs: https://core.telegram.org/bots/api#setstickerkeywords
1044
+ const setStickerKeywords = Object.assign(async (req, signal) => {
1045
+ return makeRequest("/setStickerKeywords", req ?? {}, signal, TelegramSetStickerKeywordsRequestSchema);
1046
+ }, { schema: TelegramSetStickerKeywordsRequestSchema });
1047
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1048
+ // POST https://api.telegram.org/bot{token}/setStickerMaskPosition
1049
+ // Docs: https://core.telegram.org/bots/api#setstickermaskposition
1050
+ const setStickerMaskPosition = Object.assign(async (req, signal) => {
1051
+ return makeRequest("/setStickerMaskPosition", req ?? {}, signal, TelegramSetStickerMaskPositionRequestSchema);
1052
+ }, { schema: TelegramSetStickerMaskPositionRequestSchema });
1053
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1054
+ // POST https://api.telegram.org/bot{token}/setStickerPositionInSet
1055
+ // Docs: https://core.telegram.org/bots/api#setstickerpositioninset
1056
+ const setStickerPositionInSet = Object.assign(async (req, signal) => {
1057
+ return makeRequest("/setStickerPositionInSet", req ?? {}, signal, TelegramSetStickerPositionInSetRequestSchema);
1058
+ }, { schema: TelegramSetStickerPositionInSetRequestSchema });
1059
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1060
+ // POST https://api.telegram.org/bot{token}/setStickerSetThumbnail
1061
+ // Docs: https://core.telegram.org/bots/api#setstickersetthumbnail
1062
+ const setStickerSetThumbnail = Object.assign(async (req, signal) => {
1063
+ return makeRequest("/setStickerSetThumbnail", req ?? {}, signal, TelegramSetStickerSetThumbnailRequestSchema);
1064
+ }, { schema: TelegramSetStickerSetThumbnailRequestSchema });
1065
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1066
+ // POST https://api.telegram.org/bot{token}/setStickerSetTitle
1067
+ // Docs: https://core.telegram.org/bots/api#setstickersettitle
1068
+ const setStickerSetTitle = Object.assign(async (req, signal) => {
1069
+ return makeRequest("/setStickerSetTitle", req ?? {}, signal, TelegramSetStickerSetTitleRequestSchema);
1070
+ }, { schema: TelegramSetStickerSetTitleRequestSchema });
1071
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1072
+ // POST https://api.telegram.org/bot{token}/setUserEmojiStatus
1073
+ // Docs: https://core.telegram.org/bots/api#setuseremojistatus
1074
+ const setUserEmojiStatus = Object.assign(async (req, signal) => {
1075
+ return makeRequest("/setUserEmojiStatus", req ?? {}, signal, TelegramSetUserEmojiStatusRequestSchema);
1076
+ }, { schema: TelegramSetUserEmojiStatusRequestSchema });
1077
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1078
+ // POST https://api.telegram.org/bot{token}/setWebhook
1079
+ // Docs: https://core.telegram.org/bots/api#setwebhook
1080
+ const setWebhook = Object.assign(async (req, signal) => {
1081
+ return makeRequest("/setWebhook", req ?? {}, signal, TelegramSetWebhookRequestSchema);
1082
+ }, { schema: TelegramSetWebhookRequestSchema });
1083
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1084
+ // POST https://api.telegram.org/bot{token}/stopMessageLiveLocation
1085
+ // Docs: https://core.telegram.org/bots/api#stopmessagelivelocation
1086
+ const stopMessageLiveLocation = Object.assign(async (req, signal) => {
1087
+ return makeRequest("/stopMessageLiveLocation", req ?? {}, signal, TelegramStopMessageLiveLocationRequestSchema);
1088
+ }, { schema: TelegramStopMessageLiveLocationRequestSchema });
1089
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1090
+ // POST https://api.telegram.org/bot{token}/stopPoll
1091
+ // Docs: https://core.telegram.org/bots/api#stoppoll
1092
+ const stopPoll = Object.assign(async (req, signal) => {
1093
+ return makeRequest("/stopPoll", req ?? {}, signal, TelegramStopPollRequestSchema);
1094
+ }, { schema: TelegramStopPollRequestSchema });
1095
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1096
+ // POST https://api.telegram.org/bot{token}/transferBusinessAccountStars
1097
+ // Docs: https://core.telegram.org/bots/api#transferbusinessaccountstars
1098
+ const transferBusinessAccountStars = Object.assign(async (req, signal) => {
1099
+ return makeRequest("/transferBusinessAccountStars", req ?? {}, signal, TelegramTransferBusinessAccountStarsRequestSchema);
1100
+ }, { schema: TelegramTransferBusinessAccountStarsRequestSchema });
1101
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1102
+ // POST https://api.telegram.org/bot{token}/transferGift
1103
+ // Docs: https://core.telegram.org/bots/api#transfergift
1104
+ const transferGift = Object.assign(async (req, signal) => {
1105
+ return makeRequest("/transferGift", req ?? {}, signal, TelegramTransferGiftRequestSchema);
1106
+ }, { schema: TelegramTransferGiftRequestSchema });
1107
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1108
+ // POST https://api.telegram.org/bot{token}/unbanChatMember
1109
+ // Docs: https://core.telegram.org/bots/api#unbanchatmember
1110
+ const unbanChatMember = Object.assign(async (req, signal) => {
1111
+ return makeRequest("/unbanChatMember", req ?? {}, signal, TelegramUnbanChatMemberRequestSchema);
1112
+ }, { schema: TelegramUnbanChatMemberRequestSchema });
1113
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1114
+ // POST https://api.telegram.org/bot{token}/unbanChatSenderChat
1115
+ // Docs: https://core.telegram.org/bots/api#unbanchatsenderchat
1116
+ const unbanChatSenderChat = Object.assign(async (req, signal) => {
1117
+ return makeRequest("/unbanChatSenderChat", req ?? {}, signal, TelegramUnbanChatSenderChatRequestSchema);
1118
+ }, { schema: TelegramUnbanChatSenderChatRequestSchema });
1119
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1120
+ // POST https://api.telegram.org/bot{token}/unhideGeneralForumTopic
1121
+ // Docs: https://core.telegram.org/bots/api#unhidegeneralforumtopic
1122
+ const unhideGeneralForumTopic = Object.assign(async (req, signal) => {
1123
+ return makeRequest("/unhideGeneralForumTopic", req ?? {}, signal, TelegramUnhideGeneralForumTopicRequestSchema);
1124
+ }, { schema: TelegramUnhideGeneralForumTopicRequestSchema });
1125
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1126
+ // POST https://api.telegram.org/bot{token}/unpinAllChatMessages
1127
+ // Docs: https://core.telegram.org/bots/api#unpinallchatmessages
1128
+ const unpinAllChatMessages = Object.assign(async (req, signal) => {
1129
+ return makeRequest("/unpinAllChatMessages", req ?? {}, signal, TelegramUnpinAllChatMessagesRequestSchema);
1130
+ }, { schema: TelegramUnpinAllChatMessagesRequestSchema });
1131
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1132
+ // POST https://api.telegram.org/bot{token}/unpinAllForumTopicMessages
1133
+ // Docs: https://core.telegram.org/bots/api#unpinallforumtopicmessages
1134
+ const unpinAllForumTopicMessages = Object.assign(async (req, signal) => {
1135
+ return makeRequest("/unpinAllForumTopicMessages", req ?? {}, signal, TelegramUnpinAllForumTopicMessagesRequestSchema);
1136
+ }, { schema: TelegramUnpinAllForumTopicMessagesRequestSchema });
1137
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1138
+ // POST https://api.telegram.org/bot{token}/unpinAllGeneralForumTopicMessages
1139
+ // Docs: https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
1140
+ const unpinAllGeneralForumTopicMessages = Object.assign(async (req, signal) => {
1141
+ return makeRequest("/unpinAllGeneralForumTopicMessages", req ?? {}, signal, TelegramUnpinAllGeneralForumTopicMessagesRequestSchema);
1142
+ }, { schema: TelegramUnpinAllGeneralForumTopicMessagesRequestSchema });
1143
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1144
+ // POST https://api.telegram.org/bot{token}/unpinChatMessage
1145
+ // Docs: https://core.telegram.org/bots/api#unpinchatmessage
1146
+ const unpinChatMessage = Object.assign(async (req, signal) => {
1147
+ return makeRequest("/unpinChatMessage", req ?? {}, signal, TelegramUnpinChatMessageRequestSchema);
1148
+ }, { schema: TelegramUnpinChatMessageRequestSchema });
1149
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1150
+ // POST https://api.telegram.org/bot{token}/upgradeGift
1151
+ // Docs: https://core.telegram.org/bots/api#upgradegift
1152
+ const upgradeGift = Object.assign(async (req, signal) => {
1153
+ return makeRequest("/upgradeGift", req ?? {}, signal, TelegramUpgradeGiftRequestSchema);
1154
+ }, { schema: TelegramUpgradeGiftRequestSchema });
1155
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1156
+ // POST https://api.telegram.org/bot{token}/uploadStickerFile
1157
+ // Docs: https://core.telegram.org/bots/api#uploadstickerfile
1158
+ const uploadStickerFile = Object.assign(async (req, signal) => {
1159
+ return makeRequest("/uploadStickerFile", req ?? {}, signal, TelegramUploadStickerFileRequestSchema);
1160
+ }, { schema: TelegramUploadStickerFileRequestSchema });
1161
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1162
+ // POST https://api.telegram.org/bot{token}/verifyChat
1163
+ // Docs: https://core.telegram.org/bots/api#verifychat
1164
+ const verifyChat = Object.assign(async (req, signal) => {
1165
+ return makeRequest("/verifyChat", req ?? {}, signal, TelegramVerifyChatRequestSchema);
1166
+ }, { schema: TelegramVerifyChatRequestSchema });
1167
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1168
+ // POST https://api.telegram.org/bot{token}/verifyUser
1169
+ // Docs: https://core.telegram.org/bots/api#verifyuser
1170
+ const verifyUser = Object.assign(async (req, signal) => {
1171
+ return makeRequest("/verifyUser", req ?? {}, signal, TelegramVerifyUserRequestSchema);
1172
+ }, { schema: TelegramVerifyUserRequestSchema });
1173
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1174
+ // POST https://api.telegram.org/bot{token}/approveSuggestedPost
1175
+ // Docs: https://core.telegram.org/bots/api#approvesuggestedpost
1176
+ const approveSuggestedPost = Object.assign(async (req, signal) => {
1177
+ return makeRequest("/approveSuggestedPost", req ?? {}, signal, TelegramApproveSuggestedPostRequestSchema);
1178
+ }, { schema: TelegramApproveSuggestedPostRequestSchema });
1179
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1180
+ // POST https://api.telegram.org/bot{token}/declineSuggestedPost
1181
+ // Docs: https://core.telegram.org/bots/api#declinesuggestedpost
1182
+ const declineSuggestedPost = Object.assign(async (req, signal) => {
1183
+ return makeRequest("/declineSuggestedPost", req ?? {}, signal, TelegramDeclineSuggestedPostRequestSchema);
1184
+ }, { schema: TelegramDeclineSuggestedPostRequestSchema });
1185
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1186
+ // POST https://api.telegram.org/bot{token}/getUserProfileAudios
1187
+ // Docs: https://core.telegram.org/bots/api#getuserprofileaudios
1188
+ const getUserProfileAudios = Object.assign(async (req, signal) => {
1189
+ return makeRequest("/getUserProfileAudios", req ?? {}, signal, TelegramGetUserProfileAudiosRequestSchema);
1190
+ }, { schema: TelegramGetUserProfileAudiosRequestSchema });
1191
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1192
+ // POST https://api.telegram.org/bot{token}/getUserProfilePhotos
1193
+ // Docs: https://core.telegram.org/bots/api#getuserprofilephotos
1194
+ const getUserProfilePhotos = Object.assign(async (req, signal) => {
1195
+ return makeRequest("/getUserProfilePhotos", req ?? {}, signal, TelegramGetUserProfilePhotosRequestSchema);
1196
+ }, { schema: TelegramGetUserProfilePhotosRequestSchema });
1197
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1198
+ // POST https://api.telegram.org/bot{token}/removeMyProfilePhoto
1199
+ // Docs: https://core.telegram.org/bots/api#removemyprofilephoto
1200
+ const removeMyProfilePhoto = Object.assign(async (req, signal) => {
1201
+ return makeRequest("/removeMyProfilePhoto", req ?? {}, signal, TelegramRemoveMyProfilePhotoRequestSchema);
1202
+ }, { schema: TelegramRemoveMyProfilePhotoRequestSchema });
1203
+ // sig-ok: `bot{token}` is Telegram's auth prefix, not a method namespace.
1204
+ // POST https://api.telegram.org/bot{token}/setMyProfilePhoto
1205
+ // Docs: https://core.telegram.org/bots/api#setmyprofilephoto
1206
+ const setMyProfilePhoto = Object.assign(async (req, signal) => {
1207
+ return makeRequest("/setMyProfilePhoto", req ?? {}, signal, TelegramSetMyProfilePhotoRequestSchema);
1208
+ }, { schema: TelegramSetMyProfilePhotoRequestSchema });
136
1209
  const post = {
1210
+ approveSuggestedPost,
1211
+ declineSuggestedPost,
1212
+ getUserProfileAudios,
1213
+ getUserProfilePhotos,
1214
+ removeMyProfilePhoto,
1215
+ setMyProfilePhoto,
1216
+ addStickerToSet,
1217
+ answerCallbackQuery,
1218
+ answerChatJoinRequestQuery,
1219
+ answerGuestQuery,
1220
+ answerInlineQuery,
1221
+ answerPreCheckoutQuery,
1222
+ answerShippingQuery,
1223
+ answerWebAppQuery,
1224
+ approveChatJoinRequest,
1225
+ banChatMember,
1226
+ banChatSenderChat,
1227
+ close,
1228
+ closeForumTopic,
1229
+ closeGeneralForumTopic,
1230
+ convertGiftToStars,
1231
+ copyMessage,
1232
+ copyMessages,
1233
+ createChatInviteLink,
1234
+ createChatSubscriptionInviteLink,
1235
+ createForumTopic,
1236
+ createInvoiceLink,
1237
+ createNewStickerSet,
1238
+ declineChatJoinRequest,
1239
+ deleteAllMessageReactions,
1240
+ deleteBusinessMessages,
1241
+ deleteChatPhoto,
1242
+ deleteChatStickerSet,
1243
+ deleteForumTopic,
1244
+ deleteMessage,
1245
+ deleteMessageReaction,
1246
+ deleteMessages,
1247
+ deleteMyCommands,
1248
+ deleteStickerFromSet,
1249
+ deleteStickerSet,
1250
+ deleteStory,
1251
+ deleteWebhook,
1252
+ editChatInviteLink,
1253
+ editChatSubscriptionInviteLink,
1254
+ editForumTopic,
1255
+ editGeneralForumTopic,
1256
+ editMessageCaption,
1257
+ editMessageChecklist,
1258
+ editMessageLiveLocation,
1259
+ editMessageMedia,
1260
+ editMessageReplyMarkup,
1261
+ editMessageText,
1262
+ editStory,
1263
+ editUserStarSubscription,
1264
+ exportChatInviteLink,
1265
+ forwardMessage,
1266
+ forwardMessages,
1267
+ getAvailableGifts,
1268
+ getBusinessAccountGifts,
1269
+ getBusinessAccountStarBalance,
1270
+ getBusinessConnection,
1271
+ getChat,
1272
+ getChatAdministrators,
1273
+ getChatGifts,
1274
+ getChatMember,
1275
+ getChatMemberCount,
1276
+ getChatMenuButton,
1277
+ getCustomEmojiStickers,
1278
+ getFile,
1279
+ getForumTopicIconStickers,
1280
+ getGameHighScores,
1281
+ getManagedBotAccessSettings,
1282
+ getManagedBotToken,
1283
+ getMe,
1284
+ getMyCommands,
1285
+ getMyDefaultAdministratorRights,
1286
+ getMyDescription,
1287
+ getMyName,
1288
+ getMyShortDescription,
1289
+ getMyStarBalance,
1290
+ getStarTransactions,
1291
+ getStickerSet,
1292
+ getUpdates,
1293
+ getUserChatBoosts,
1294
+ getUserGifts,
1295
+ getUserPersonalChatMessages,
1296
+ getWebhookInfo,
1297
+ giftPremiumSubscription,
1298
+ hideGeneralForumTopic,
1299
+ leaveChat,
1300
+ logOut,
1301
+ pinChatMessage,
1302
+ postStory,
1303
+ promoteChatMember,
1304
+ readBusinessMessage,
1305
+ refundStarPayment,
1306
+ removeBusinessAccountProfilePhoto,
1307
+ removeChatVerification,
1308
+ removeUserVerification,
1309
+ reopenForumTopic,
1310
+ reopenGeneralForumTopic,
1311
+ replaceManagedBotToken,
1312
+ replaceStickerInSet,
1313
+ repostStory,
1314
+ restrictChatMember,
1315
+ revokeChatInviteLink,
1316
+ savePreparedInlineMessage,
1317
+ savePreparedKeyboardButton,
1318
+ sendAnimation,
1319
+ sendAudio,
1320
+ sendChatAction,
1321
+ sendChatJoinRequestWebApp,
1322
+ sendChecklist,
1323
+ sendContact,
1324
+ sendDice,
1325
+ sendDocument,
1326
+ sendGame,
1327
+ sendGift,
1328
+ sendInvoice,
1329
+ sendLivePhoto,
1330
+ sendLocation,
1331
+ sendMediaGroup,
137
1332
  sendMessage,
1333
+ sendMessageDraft,
1334
+ sendPaidMedia,
138
1335
  sendPhoto,
1336
+ sendPoll,
1337
+ sendRichMessage,
1338
+ sendRichMessageDraft,
1339
+ sendSticker,
1340
+ sendVenue,
139
1341
  sendVideo,
140
- sendAudio,
1342
+ sendVideoNote,
1343
+ sendVoice,
1344
+ setBusinessAccountBio,
1345
+ setBusinessAccountGiftSettings,
1346
+ setBusinessAccountName,
1347
+ setBusinessAccountProfilePhoto,
1348
+ setBusinessAccountUsername,
1349
+ setChatAdministratorCustomTitle,
1350
+ setChatDescription,
1351
+ setChatMemberTag,
1352
+ setChatMenuButton,
1353
+ setChatPermissions,
1354
+ setChatPhoto,
1355
+ setChatStickerSet,
1356
+ setChatTitle,
1357
+ setCustomEmojiStickerSetThumbnail,
1358
+ setGameScore,
1359
+ setManagedBotAccessSettings,
1360
+ setMessageReaction,
1361
+ setMyCommands,
1362
+ setMyDefaultAdministratorRights,
1363
+ setMyDescription,
1364
+ setMyName,
1365
+ setMyShortDescription,
1366
+ setPassportDataErrors,
1367
+ setStickerEmojiList,
1368
+ setStickerKeywords,
1369
+ setStickerMaskPosition,
1370
+ setStickerPositionInSet,
1371
+ setStickerSetThumbnail,
1372
+ setStickerSetTitle,
1373
+ setUserEmojiStatus,
1374
+ setWebhook,
1375
+ stopMessageLiveLocation,
1376
+ stopPoll,
1377
+ transferBusinessAccountStars,
1378
+ transferGift,
1379
+ unbanChatMember,
1380
+ unbanChatSenderChat,
1381
+ unhideGeneralForumTopic,
1382
+ unpinAllChatMessages,
1383
+ unpinAllForumTopicMessages,
1384
+ unpinAllGeneralForumTopicMessages,
1385
+ unpinChatMessage,
1386
+ upgradeGift,
1387
+ uploadStickerFile,
1388
+ verifyChat,
1389
+ verifyUser,
141
1390
  };
142
1391
  return attachExamples({
143
- sendMessage,
144
- sendPhoto,
145
- sendVideo,
146
- sendAudio,
1392
+ ...post,
147
1393
  post,
148
1394
  });
149
1395
  }