@mtkruto/node 0.1.106 → 0.1.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/4_constants.d.ts +2 -2
- package/esm/4_constants.js +3 -3
- package/esm/5_client.d.ts +1 -0
- package/esm/5_client.js +1 -0
- package/esm/client/3_types.d.ts +18 -13
- package/esm/client/4_client.d.ts +48 -21
- package/esm/client/4_client.js +56 -37
- package/esm/tl/2_types.d.ts +634 -75
- package/esm/tl/2_types.js +2387 -289
- package/esm/tl/3_functions.d.ts +260 -57
- package/esm/tl/3_functions.js +869 -203
- package/esm/types/0_audio.d.ts +9 -9
- package/esm/types/0_bot_command.d.ts +2 -0
- package/esm/types/0_chat_action.d.ts +1 -0
- package/esm/types/0_chat_administrator_rights.d.ts +13 -13
- package/esm/types/0_chat_photo.d.ts +7 -6
- package/esm/types/0_chat_photo.js +1 -1
- package/esm/types/0_contact.d.ts +6 -6
- package/esm/types/0_dice.d.ts +3 -3
- package/esm/types/0_force_reply.d.ts +4 -4
- package/esm/types/0_input_contact_message_content.d.ts +5 -0
- package/esm/types/0_input_location_message_content.d.ts +7 -0
- package/esm/types/0_input_venue_message_content.d.ts +10 -1
- package/esm/types/0_keyboard_button_poll_type.d.ts +3 -3
- package/esm/types/0_location.d.ts +7 -7
- package/esm/types/0_login_url.d.ts +4 -5
- package/esm/types/0_mask_position.d.ts +0 -1
- package/esm/types/0_message_entity.d.ts +6 -6
- package/esm/types/0_parse_mode.d.ts +1 -0
- package/esm/types/0_poll_option.d.ts +2 -2
- package/esm/types/0_reply_keyboard_remove.d.ts +3 -3
- package/esm/types/0_thumbnail.d.ts +6 -6
- package/esm/types/0_venue.d.ts +6 -6
- package/esm/types/0_voice.d.ts +6 -6
- package/esm/types/0_web_app_info.d.ts +1 -2
- package/esm/types/1_animation.d.ts +9 -9
- package/esm/types/1_chat.d.ts +29 -28
- package/esm/types/1_document.d.ts +6 -7
- package/esm/types/1_keyboard_button.d.ts +1 -1
- package/esm/types/1_photo.d.ts +3 -3
- package/esm/types/1_sticker.d.ts +2 -2
- package/esm/types/1_user.d.ts +2 -1
- package/esm/types/1_video.d.ts +4 -4
- package/esm/types/1_video_note.d.ts +3 -3
- package/esm/types/3_message.js +1 -1
- package/package.json +1 -1
- package/script/4_constants.d.ts +2 -2
- package/script/4_constants.js +3 -3
- package/script/5_client.d.ts +1 -0
- package/script/5_client.js +1 -0
- package/script/client/3_types.d.ts +18 -13
- package/script/client/4_client.d.ts +48 -21
- package/script/client/4_client.js +56 -37
- package/script/tl/2_types.d.ts +634 -75
- package/script/tl/2_types.js +2454 -321
- package/script/tl/3_functions.d.ts +260 -57
- package/script/tl/3_functions.js +895 -211
- package/script/types/0_audio.d.ts +9 -9
- package/script/types/0_bot_command.d.ts +2 -0
- package/script/types/0_chat_action.d.ts +1 -0
- package/script/types/0_chat_administrator_rights.d.ts +13 -13
- package/script/types/0_chat_photo.d.ts +7 -6
- package/script/types/0_chat_photo.js +1 -1
- package/script/types/0_contact.d.ts +6 -6
- package/script/types/0_dice.d.ts +3 -3
- package/script/types/0_force_reply.d.ts +4 -4
- package/script/types/0_input_contact_message_content.d.ts +5 -0
- package/script/types/0_input_location_message_content.d.ts +7 -0
- package/script/types/0_input_venue_message_content.d.ts +10 -1
- package/script/types/0_keyboard_button_poll_type.d.ts +3 -3
- package/script/types/0_location.d.ts +7 -7
- package/script/types/0_login_url.d.ts +4 -5
- package/script/types/0_mask_position.d.ts +0 -1
- package/script/types/0_message_entity.d.ts +6 -6
- package/script/types/0_parse_mode.d.ts +1 -0
- package/script/types/0_poll_option.d.ts +2 -2
- package/script/types/0_reply_keyboard_remove.d.ts +3 -3
- package/script/types/0_thumbnail.d.ts +6 -6
- package/script/types/0_venue.d.ts +6 -6
- package/script/types/0_voice.d.ts +6 -6
- package/script/types/0_web_app_info.d.ts +1 -2
- package/script/types/1_animation.d.ts +9 -9
- package/script/types/1_chat.d.ts +29 -28
- package/script/types/1_document.d.ts +6 -7
- package/script/types/1_keyboard_button.d.ts +1 -1
- package/script/types/1_photo.d.ts +3 -3
- package/script/types/1_sticker.d.ts +2 -2
- package/script/types/1_user.d.ts +2 -1
- package/script/types/1_video.d.ts +4 -4
- package/script/types/1_video_note.d.ts +3 -3
- package/script/types/3_message.js +1 -1
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
2
|
import { Thumbnail } from "./0_thumbnail.js";
|
|
3
|
-
/** This object represents a general file (as opposed to photos, voice messages and audio files). */
|
|
4
3
|
export interface Document {
|
|
5
|
-
/**
|
|
4
|
+
/** A file identifier that can be used to download or reuse this file. */
|
|
6
5
|
fileId: string;
|
|
7
|
-
/**
|
|
6
|
+
/** A file identifier that can be used to identify this file. */
|
|
8
7
|
fileUniqueId: string;
|
|
9
|
-
/**
|
|
8
|
+
/** Thumbnails of the document. */
|
|
10
9
|
thumbnails: Thumbnail[];
|
|
11
|
-
/**
|
|
10
|
+
/** The original file name. */
|
|
12
11
|
fileName: string;
|
|
13
|
-
/** MIME type of the file
|
|
12
|
+
/** MIME type of the file. */
|
|
14
13
|
mimeType: string;
|
|
15
|
-
/**
|
|
14
|
+
/** Size of the file in bytes. */
|
|
16
15
|
fileSize: number;
|
|
17
16
|
}
|
|
18
17
|
export declare function constructDocument(document: types.Document, fileNameAttribute: types.DocumentAttributeFilename, fileId: string, fileUniqueId: string): Document;
|
|
@@ -4,7 +4,7 @@ import { KeyboardButtonPollType } from "./0_keyboard_button_poll_type.js";
|
|
|
4
4
|
import { WebAppInfo } from "./0_web_app_info.js";
|
|
5
5
|
export declare namespace KeyboardButton {
|
|
6
6
|
interface Text {
|
|
7
|
-
/**
|
|
7
|
+
/** The button's text. */
|
|
8
8
|
text: string;
|
|
9
9
|
}
|
|
10
10
|
/** This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. */
|
package/esm/types/1_photo.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ import { types } from "../2_tl.js";
|
|
|
2
2
|
import { Thumbnail } from "./0_thumbnail.js";
|
|
3
3
|
/** This object represents a photo. */
|
|
4
4
|
export interface Photo {
|
|
5
|
-
/**
|
|
5
|
+
/** A file identifier that can be used to download or reuse this file. */
|
|
6
6
|
fileId: string;
|
|
7
|
-
/**
|
|
7
|
+
/** A file identifier that can be used to identify this file. */
|
|
8
8
|
fileUniqueId: string;
|
|
9
9
|
/** Photo width */
|
|
10
10
|
width: number;
|
|
11
11
|
/** Photo height */
|
|
12
12
|
height: number;
|
|
13
|
-
/**
|
|
13
|
+
/** Size of the file in bytes. */
|
|
14
14
|
fileSize: number;
|
|
15
15
|
thumbnails: Thumbnail[];
|
|
16
16
|
}
|
package/esm/types/1_sticker.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { MaskPosition } from "./0_mask_position.js";
|
|
|
4
4
|
import { Thumbnail } from "./0_thumbnail.js";
|
|
5
5
|
/** This object represents a sticker. */
|
|
6
6
|
export interface Sticker {
|
|
7
|
-
/**
|
|
7
|
+
/** A file identifier that can be used to download or reuse this file. */
|
|
8
8
|
fileId: string;
|
|
9
|
-
/**
|
|
9
|
+
/** A file identifier that can be used to identify this file. */
|
|
10
10
|
fileUniqueId: string;
|
|
11
11
|
/** Type of the sticker, currently one of "regular", "mask", "customEmoji". The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. */
|
|
12
12
|
type: "regular" | "mask" | "customEmoji";
|
package/esm/types/1_user.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Color } from "./0_color.js";
|
|
|
5
5
|
export interface User {
|
|
6
6
|
/** Unique identifier for this user or bot */
|
|
7
7
|
id: number;
|
|
8
|
+
/** A color that can be displayed instead of the user's photo. */
|
|
8
9
|
color: Color;
|
|
9
10
|
/** True, if this user is a bot */
|
|
10
11
|
isBot: boolean;
|
|
@@ -16,7 +17,7 @@ export interface User {
|
|
|
16
17
|
username?: string;
|
|
17
18
|
/** Additional usernames */
|
|
18
19
|
also?: string[];
|
|
19
|
-
/**
|
|
20
|
+
/** The user's photo. */
|
|
20
21
|
photo?: ChatPhoto.User;
|
|
21
22
|
/** [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the user's language */
|
|
22
23
|
languageCode?: string;
|
package/esm/types/1_video.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { types } from "../2_tl.js";
|
|
|
2
2
|
import { Thumbnail } from "./0_thumbnail.js";
|
|
3
3
|
/** This object represents a video file. */
|
|
4
4
|
export interface Video {
|
|
5
|
-
/**
|
|
5
|
+
/** A file identifier that can be used to download or reuse this file. */
|
|
6
6
|
fileId: string;
|
|
7
|
-
/**
|
|
7
|
+
/** A file identifier that can be used to identify this file. */
|
|
8
8
|
fileUniqueId: string;
|
|
9
9
|
/** Video width as defined by sender */
|
|
10
10
|
width: number;
|
|
@@ -16,9 +16,9 @@ export interface Video {
|
|
|
16
16
|
thumbnails: Thumbnail[];
|
|
17
17
|
/** Original filename as defined by sender */
|
|
18
18
|
fileName?: string;
|
|
19
|
-
/** MIME type of the file
|
|
19
|
+
/** MIME type of the file. */
|
|
20
20
|
mimeType: string;
|
|
21
|
-
/**
|
|
21
|
+
/** Size of the file in bytes. */
|
|
22
22
|
fileSize: number;
|
|
23
23
|
}
|
|
24
24
|
export declare function constructVideo(document: types.Document, videoAttribute: types.DocumentAttributeVideo, fileName: string | undefined, fileId: string, fileUniqueId: string): Video;
|
|
@@ -2,9 +2,9 @@ import { types } from "../2_tl.js";
|
|
|
2
2
|
import { Thumbnail } from "./0_thumbnail.js";
|
|
3
3
|
/** This object represents a video message (available in Telegram apps as of v.4.0). */
|
|
4
4
|
export interface VideoNote {
|
|
5
|
-
/**
|
|
5
|
+
/** A file identifier that can be used to download or reuse this file. */
|
|
6
6
|
fileId: string;
|
|
7
|
-
/**
|
|
7
|
+
/** A file identifier that can be used to identify this file. */
|
|
8
8
|
fileUniqueId: string;
|
|
9
9
|
/** Video width and height (diameter of the video message) as defined by sender */
|
|
10
10
|
length: number;
|
|
@@ -14,7 +14,7 @@ export interface VideoNote {
|
|
|
14
14
|
thumbnails: Thumbnail[];
|
|
15
15
|
/** Original filename as defined by sender */
|
|
16
16
|
fileName?: string;
|
|
17
|
-
/**
|
|
17
|
+
/** Size of the file in bytes. */
|
|
18
18
|
fileSize: number;
|
|
19
19
|
}
|
|
20
20
|
export declare function constructVideoNote(document: types.Document, videoAttribute: types.DocumentAttributeVideo, fileId: string, fileUniqueId: string): VideoNote;
|
package/esm/types/3_message.js
CHANGED
|
@@ -46,7 +46,7 @@ async function getSender(message_, getEntity) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
async function getReply(message_, chat, getMessage) {
|
|
49
|
-
if (getMessage && message_.replyTo instanceof types.MessageReplyHeader) {
|
|
49
|
+
if (getMessage && message_.replyTo instanceof types.MessageReplyHeader && message_.replyTo.replyToMsgId) {
|
|
50
50
|
let isTopicMessage = false;
|
|
51
51
|
if (message_.replyTo.forumTopic) {
|
|
52
52
|
isTopicMessage = true;
|
package/package.json
CHANGED
package/script/4_constants.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export type PublicKeys = readonly [bigint, [bigint, bigint]][];
|
|
|
4
4
|
export declare const PUBLIC_KEYS: PublicKeys;
|
|
5
5
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
6
6
|
export declare const INITIAL_DC: DC;
|
|
7
|
-
export declare const LAYER =
|
|
8
|
-
export declare const APP_VERSION = "MTKruto 0.1.
|
|
7
|
+
export declare const LAYER = 166;
|
|
8
|
+
export declare const APP_VERSION = "MTKruto 0.1.108";
|
|
9
9
|
export declare const DEVICE_MODEL: string;
|
|
10
10
|
export declare const LANG_CODE: string;
|
|
11
11
|
export declare const LANG_PACK = "";
|
package/script/4_constants.js
CHANGED
|
@@ -78,9 +78,9 @@ exports.PUBLIC_KEYS = Object.freeze([
|
|
|
78
78
|
],
|
|
79
79
|
]);
|
|
80
80
|
exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
81
|
-
exports.INITIAL_DC = "2
|
|
82
|
-
exports.LAYER =
|
|
83
|
-
exports.APP_VERSION = "MTKruto 0.1.
|
|
81
|
+
exports.INITIAL_DC = "2";
|
|
82
|
+
exports.LAYER = 166;
|
|
83
|
+
exports.APP_VERSION = "MTKruto 0.1.108";
|
|
84
84
|
// @ts-ignore: lib
|
|
85
85
|
exports.DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
86
86
|
exports.LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
package/script/5_client.d.ts
CHANGED
package/script/5_client.js
CHANGED
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./client/2_client_plain.js"), exports);
|
|
18
|
+
__exportStar(require("./client/3_types.js"), exports);
|
|
18
19
|
__exportStar(require("./client/4_client.js"), exports);
|
|
@@ -3,7 +3,7 @@ import { functions, types } from "../2_tl.js";
|
|
|
3
3
|
import { BotCommandScope, CallbackQuery, ChatID, ForceReply, InlineKeyboardMarkup, InlineQuery, InlineQueryResultButton, Message, MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "../3_types.js";
|
|
4
4
|
import { With } from "./0_utilities.js";
|
|
5
5
|
import { ClientPlainParams } from "./2_client_plain.js";
|
|
6
|
-
|
|
6
|
+
import { ParseMode } from "../3_types.js";
|
|
7
7
|
export interface ClientParams extends ClientPlainParams {
|
|
8
8
|
/**
|
|
9
9
|
* A parse mode to use when the `parseMode` parameter is not specified when sending or editing messages. Defauls to `ParseMode.None`.
|
|
@@ -40,13 +40,13 @@ export interface ClientParams extends ClientPlainParams {
|
|
|
40
40
|
errorHandler?: (err: unknown, function_: types.Type | functions.Function<unknown>, n: number) => MaybePromise<boolean>;
|
|
41
41
|
}
|
|
42
42
|
export interface AnswerCallbackQueryParams {
|
|
43
|
-
/**
|
|
43
|
+
/** A text to be shown to the user. */
|
|
44
44
|
text?: string;
|
|
45
|
-
/**
|
|
45
|
+
/** Whether to show the text as an alert (popup). */
|
|
46
46
|
alert?: boolean;
|
|
47
|
-
/** URL to be opened */
|
|
47
|
+
/** A URL to be opened. */
|
|
48
48
|
url?: string;
|
|
49
|
-
/**
|
|
49
|
+
/** TTL of answer caches in seconds. */
|
|
50
50
|
cacheTime?: number;
|
|
51
51
|
}
|
|
52
52
|
export interface AuthorizeUserParams<S = string> {
|
|
@@ -135,19 +135,24 @@ export interface ForwardMessagesParams {
|
|
|
135
135
|
}
|
|
136
136
|
export interface SendPollParams {
|
|
137
137
|
/**
|
|
138
|
-
*
|
|
138
|
+
* Whether the poll should be anonymous.
|
|
139
|
+
*/
|
|
139
140
|
isAnonymous?: boolean;
|
|
140
141
|
/**
|
|
141
|
-
* The type of the poll.
|
|
142
|
+
* The type of the poll.
|
|
143
|
+
*/
|
|
142
144
|
type?: "quiz" | "regular";
|
|
143
145
|
/**
|
|
144
|
-
*
|
|
146
|
+
* Whether multiple selections should be allowed. Only valid for regular polls.
|
|
147
|
+
*/
|
|
145
148
|
allowMultipleAnswers?: boolean;
|
|
146
149
|
/**
|
|
147
|
-
* Index of the correct option. Required for
|
|
150
|
+
* Index of the correct option. Required for quiz polls.
|
|
151
|
+
*/
|
|
148
152
|
correctOptionIndex?: number;
|
|
149
153
|
/**
|
|
150
|
-
*
|
|
154
|
+
* A text that will be shown to the user when the poll is answered. Only valid for quiz polls.
|
|
155
|
+
*/
|
|
151
156
|
explanation?: string;
|
|
152
157
|
/**
|
|
153
158
|
* The parse mode to use for the explanation. If not provided, the default parse mode will be used.
|
|
@@ -158,15 +163,15 @@ export interface SendPollParams {
|
|
|
158
163
|
*/
|
|
159
164
|
explanationEntities?: MessageEntity[];
|
|
160
165
|
/**
|
|
161
|
-
*
|
|
166
|
+
* Duration of the poll in seconds. Must be in the range of 5-600. Cannot be used simultaneously with `closeDate`.
|
|
162
167
|
*/
|
|
163
168
|
openPeriod?: number;
|
|
164
169
|
/**
|
|
165
|
-
*
|
|
170
|
+
* The time in which the poll will be closed. Must be at least 5 seconds in the future, and no more than 600. Cannot be used simultaneously with `openPeriod`.
|
|
166
171
|
*/
|
|
167
172
|
closeDate?: Date;
|
|
168
173
|
/**
|
|
169
|
-
*
|
|
174
|
+
* Whether the poll should be closed as soon as it is sent, allowing no answers.
|
|
170
175
|
*/
|
|
171
176
|
isClosed?: boolean;
|
|
172
177
|
/**
|
|
@@ -2,11 +2,11 @@ import { MaybePromise } from "../1_utilities.js";
|
|
|
2
2
|
import { functions, ReadObject, types } from "../2_tl.js";
|
|
3
3
|
import { Storage } from "../3_storage.js";
|
|
4
4
|
import { DC } from "../3_transport.js";
|
|
5
|
-
import { BotCommand, ChatAction, ChatID, InlineQueryResult, Message } from "../3_types.js";
|
|
5
|
+
import { BotCommand, ChatAction, ChatID, InlineQueryResult, Message, ParseMode, User } from "../3_types.js";
|
|
6
6
|
import { Migrate } from "../4_errors.js";
|
|
7
7
|
import { With } from "./0_utilities.js";
|
|
8
8
|
import { ClientAbstract } from "./1_client_abstract.js";
|
|
9
|
-
import { AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, ClientParams, DownloadParams, EditMessageParams, FilterableUpdates, FilterUpdate, ForwardMessagesParams, GetMyCommandsParams, Handler,
|
|
9
|
+
import { AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, ClientParams, DownloadParams, EditMessageParams, FilterableUpdates, FilterUpdate, ForwardMessagesParams, GetMyCommandsParams, Handler, SendMessagesParams, SendPollParams, SetMyCommandsParams, Update, UploadParams } from "./3_types.js";
|
|
10
10
|
declare const getEntity: unique symbol;
|
|
11
11
|
declare const getStickerSetName: unique symbol;
|
|
12
12
|
export declare const handleMigrationError: unique symbol;
|
|
@@ -135,64 +135,82 @@ export declare class Client extends ClientAbstract {
|
|
|
135
135
|
/**
|
|
136
136
|
* Send a text message.
|
|
137
137
|
*
|
|
138
|
+
* @method
|
|
138
139
|
* @param chatId The chat to send the message to.
|
|
139
140
|
* @param text The message's text.
|
|
140
|
-
* @
|
|
141
|
+
* @returns The sent text message.
|
|
141
142
|
*/
|
|
142
143
|
sendMessage(chatId: ChatID, text: string, params?: SendMessagesParams): Promise<With<Message, "text">>;
|
|
143
144
|
private parseText;
|
|
144
145
|
/**
|
|
145
146
|
* Edit a message's text.
|
|
146
147
|
*
|
|
148
|
+
* @method
|
|
147
149
|
* @param chatId The chat where the message is.
|
|
148
150
|
* @param messageId The ID of the message.
|
|
149
151
|
* @param text The new text of the message.
|
|
150
|
-
* @
|
|
152
|
+
* @returns The edited text message.
|
|
151
153
|
*/
|
|
152
154
|
editMessageText(chatId: ChatID, messageId: number, text: string, params?: EditMessageParams): Promise<With<Message, "text">>;
|
|
153
155
|
private getMessagesInner;
|
|
154
156
|
/**
|
|
155
157
|
* Retrieve multiple messages.
|
|
156
158
|
*
|
|
159
|
+
* @method
|
|
157
160
|
* @param chatId The identifier of the chat to retrieve the messages from.
|
|
158
161
|
* @param messageIds The identifiers of the messages to retrieve.
|
|
159
|
-
* @
|
|
162
|
+
* @example ```ts
|
|
163
|
+
* const message = await client.getMessages("@MTKruto", [210, 212]);
|
|
164
|
+
* ```
|
|
165
|
+
* @returns The retrieved messages.
|
|
160
166
|
*/
|
|
161
|
-
getMessages(
|
|
167
|
+
getMessages(chatId: ChatID, messageIds: number[]): Promise<Omit<Message, "replyToMessage">[]>;
|
|
162
168
|
private [getMessageWithReply];
|
|
163
169
|
/**
|
|
164
170
|
* Retrieve a single message.
|
|
165
171
|
*
|
|
172
|
+
* @method
|
|
166
173
|
* @param chatId The identifier of the chat to retrieve the message from.
|
|
167
174
|
* @param messageId The identifier of the message to retrieve.
|
|
168
|
-
* @
|
|
175
|
+
* @example ```ts
|
|
176
|
+
* const message = await client.getMessage("@MTKruto", 212);
|
|
177
|
+
* ```
|
|
178
|
+
* @returns The retrieved message.
|
|
169
179
|
*/
|
|
170
180
|
getMessage(chatId: ChatID, messageId: number): Promise<Omit<Message, "replyToMessage"> | null>;
|
|
171
181
|
private downloadInner;
|
|
172
182
|
/**
|
|
173
183
|
* Download a file.
|
|
174
184
|
*
|
|
175
|
-
* @param fileId The identifier of the file to download.
|
|
176
185
|
* @method
|
|
186
|
+
* @param fileId The identifier of the file to download.
|
|
187
|
+
* @example ```ts
|
|
188
|
+
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
189
|
+
* await outFile.write(chunk);
|
|
190
|
+
* }
|
|
191
|
+
* ```
|
|
192
|
+
* @returns A generator yielding the contents of the file.
|
|
177
193
|
*/
|
|
178
194
|
download(fileId: string, params?: DownloadParams): Promise<AsyncGenerator<Uint8Array, void, unknown>>;
|
|
179
195
|
private [getStickerSetName];
|
|
180
196
|
/**
|
|
181
197
|
* Forward multiple messages.
|
|
182
198
|
*
|
|
199
|
+
* @method
|
|
183
200
|
* @param from The identifier of the chat to forward the messages from.
|
|
184
201
|
* @param to The identifier of the chat to forward the messages to.
|
|
185
202
|
* @param messageIds The identifiers of the messages to forward.
|
|
186
|
-
* @
|
|
203
|
+
* @returns The forwarded messages.
|
|
187
204
|
*/
|
|
188
205
|
forwardMessages(from: ChatID, to: ChatID, messageIds: number[], params?: ForwardMessagesParams): Promise<Message[]>;
|
|
189
206
|
/**
|
|
190
207
|
* Forward a single message.
|
|
191
208
|
*
|
|
209
|
+
* @method
|
|
192
210
|
* @param from The identifier of the chat to forward the message from.
|
|
193
211
|
* @param to The identifier of the chat to forward the message to.
|
|
194
212
|
* @param messageId The identifier of the message to forward.
|
|
195
|
-
* @
|
|
213
|
+
* @returns The forwarded message.
|
|
196
214
|
*/
|
|
197
215
|
forwardMessage(from: ChatID, to: ChatID, messageId: number, params?: ForwardMessagesParams): Promise<Message>;
|
|
198
216
|
/**
|
|
@@ -200,13 +218,13 @@ export declare class Client extends ClientAbstract {
|
|
|
200
218
|
*
|
|
201
219
|
* @method
|
|
202
220
|
*/
|
|
203
|
-
getMe(): Promise<
|
|
221
|
+
getMe(): Promise<User>;
|
|
204
222
|
private handleUpdate;
|
|
205
223
|
/**
|
|
206
224
|
* Answer a callback query. Bot-only.
|
|
207
225
|
*
|
|
208
|
-
* @param id ID of the callback query to answer.
|
|
209
226
|
* @method
|
|
227
|
+
* @param id ID of the callback query to answer.
|
|
210
228
|
*/
|
|
211
229
|
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
212
230
|
private usernameResolver;
|
|
@@ -215,33 +233,36 @@ export declare class Client extends ClientAbstract {
|
|
|
215
233
|
/**
|
|
216
234
|
* Send a poll.
|
|
217
235
|
*
|
|
236
|
+
* @method
|
|
218
237
|
* @param chatId The chat to send the poll to.
|
|
219
238
|
* @param question The poll's question.
|
|
220
239
|
* @param options The poll's options.
|
|
221
|
-
* @
|
|
240
|
+
* @returns The sent poll.
|
|
222
241
|
*/
|
|
223
242
|
sendPoll(chatId: ChatID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<With<Message, "poll">>;
|
|
224
243
|
/**
|
|
225
244
|
* Send a chat action.
|
|
226
245
|
*
|
|
246
|
+
* @method
|
|
227
247
|
* @param chatId The chat to send the chat action to.
|
|
228
248
|
* @param action The chat action.
|
|
229
249
|
* @param messageThreadId The thread to send the chat action to.
|
|
230
|
-
* @method
|
|
231
250
|
*/
|
|
232
|
-
sendChatAction(chatId: ChatID,
|
|
251
|
+
sendChatAction(chatId: ChatID, action: ChatAction, params?: {
|
|
252
|
+
messageThreadId?: number;
|
|
253
|
+
}): Promise<void>;
|
|
233
254
|
/**
|
|
234
255
|
* Upload a file.
|
|
235
256
|
*
|
|
236
|
-
* @param contents The contents of the file.
|
|
237
257
|
* @method
|
|
258
|
+
* @param contents The contents of the file.
|
|
238
259
|
*/
|
|
239
260
|
upload(contents: Uint8Array, params?: UploadParams): Promise<types.InputFile | types.InputFileBig>;
|
|
240
261
|
/**
|
|
241
262
|
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
242
263
|
*
|
|
243
|
-
* @param commands The commands to set.
|
|
244
264
|
* @method
|
|
265
|
+
* @param commands The commands to set.
|
|
245
266
|
*/
|
|
246
267
|
setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise<void>;
|
|
247
268
|
/**
|
|
@@ -251,9 +272,9 @@ export declare class Client extends ClientAbstract {
|
|
|
251
272
|
/**
|
|
252
273
|
* Answer an inline query. Bot-only.
|
|
253
274
|
*
|
|
275
|
+
* @method
|
|
254
276
|
* @param id The ID of the inline query to answer.
|
|
255
277
|
* @param results The results to answer with.
|
|
256
|
-
* @method
|
|
257
278
|
*/
|
|
258
279
|
answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
|
|
259
280
|
private handle;
|
|
@@ -296,18 +317,24 @@ export declare class Client extends ClientAbstract {
|
|
|
296
317
|
*
|
|
297
318
|
* @method
|
|
298
319
|
*/
|
|
299
|
-
getMyDescription(
|
|
320
|
+
getMyDescription(params?: {
|
|
321
|
+
languageCode?: string;
|
|
322
|
+
}): Promise<string>;
|
|
300
323
|
/**
|
|
301
324
|
* Set the bot's name in the given language. Bot-only.
|
|
302
325
|
*
|
|
303
326
|
* @method
|
|
304
327
|
*/
|
|
305
|
-
getMyName(
|
|
328
|
+
getMyName(params?: {
|
|
329
|
+
languageCode?: string;
|
|
330
|
+
}): Promise<string>;
|
|
306
331
|
/**
|
|
307
332
|
* Get the bot's short description in the given language. Bot-only.
|
|
308
333
|
*
|
|
309
334
|
* @method
|
|
310
335
|
*/
|
|
311
|
-
getMyShortDescription(
|
|
336
|
+
getMyShortDescription(params?: {
|
|
337
|
+
languageCode?: string;
|
|
338
|
+
}): Promise<string>;
|
|
312
339
|
}
|
|
313
340
|
export {};
|