@mtkruto/node 0.1.129 → 0.1.131
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/0_deps.d.ts +1 -0
- package/esm/0_deps.js +9 -0
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/client/3_types.d.ts +363 -3
- package/esm/client/5_client.d.ts +113 -5
- package/esm/client/5_client.js +561 -103
- package/esm/deps/deno.land/std@0.209.0/media_types/extension.d.ts +17 -0
- package/esm/deps/deno.land/std@0.209.0/media_types/extension.js +26 -0
- package/esm/deps/deno.land/std@0.209.0/media_types/extensions_by_type.d.ts +20 -0
- package/esm/deps/deno.land/std@0.209.0/media_types/extensions_by_type.js +31 -0
- package/esm/storage/0_storage.d.ts +3 -1
- package/esm/storage/0_storage.js +18 -5
- package/esm/tl/0_tl_raw_reader.js +1 -1
- package/esm/tl/3_utilities.d.ts +1 -0
- package/esm/tl/3_utilities.js +11 -0
- package/esm/types/1__getters.d.ts +1 -0
- package/esm/types/1_sticker.js +5 -4
- package/esm/types/4_chat.d.ts +3 -2
- package/esm/types/4_chat.js +16 -27
- package/package.json +1 -1
- package/script/0_deps.d.ts +1 -0
- package/script/0_deps.js +11 -1
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/client/3_types.d.ts +363 -3
- package/script/client/5_client.d.ts +113 -5
- package/script/client/5_client.js +558 -100
- package/script/deps/deno.land/std@0.209.0/media_types/extension.d.ts +17 -0
- package/script/deps/deno.land/std@0.209.0/media_types/extension.js +30 -0
- package/script/deps/deno.land/std@0.209.0/media_types/extensions_by_type.d.ts +20 -0
- package/script/deps/deno.land/std@0.209.0/media_types/extensions_by_type.js +35 -0
- package/script/storage/0_storage.d.ts +3 -1
- package/script/storage/0_storage.js +18 -5
- package/script/tl/0_tl_raw_reader.js +1 -1
- package/script/tl/3_utilities.d.ts +1 -0
- package/script/tl/3_utilities.js +13 -1
- package/script/types/1__getters.d.ts +1 -0
- package/script/types/1_sticker.js +4 -3
- package/script/types/4_chat.d.ts +3 -2
- package/script/types/4_chat.js +17 -27
package/esm/0_deps.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./deps/deno.land/std@0.209.0/assert/mod.js";
|
|
|
2
2
|
export * as path from "./deps/deno.land/std@0.209.0/path/mod.js";
|
|
3
3
|
export { decodeBase64, encodeBase64 } from "./deps/deno.land/std@0.209.0/encoding/base64.js";
|
|
4
4
|
export { contentType } from "./deps/deno.land/std@0.209.0/media_types/content_type.js";
|
|
5
|
+
export declare function extension(mimeType: string): string;
|
|
5
6
|
export { ctr256, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.3.3/mod.js";
|
|
6
7
|
export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
|
|
7
8
|
export { Mutex, type MutexInterface } from "async-mutex";
|
package/esm/0_deps.js
CHANGED
|
@@ -2,6 +2,15 @@ export * from "./deps/deno.land/std@0.209.0/assert/mod.js";
|
|
|
2
2
|
export * as path from "./deps/deno.land/std@0.209.0/path/mod.js";
|
|
3
3
|
export { decodeBase64, encodeBase64 } from "./deps/deno.land/std@0.209.0/encoding/base64.js";
|
|
4
4
|
export { contentType } from "./deps/deno.land/std@0.209.0/media_types/content_type.js";
|
|
5
|
+
import { extension as extension_ } from "./deps/deno.land/std@0.209.0/media_types/extension.js";
|
|
6
|
+
export function extension(mimeType) {
|
|
7
|
+
if (mimeType == "application/x-tgsticker") {
|
|
8
|
+
return "tgs";
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return extension_(mimeType) || "unknown";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
5
14
|
export { ctr256, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.3.3/mod.js";
|
|
6
15
|
export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
|
|
7
16
|
export { Mutex } from "async-mutex";
|
package/esm/4_constants.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type PublicKeys = readonly [bigint, [bigint, bigint]][];
|
|
|
4
4
|
export declare const PUBLIC_KEYS: PublicKeys;
|
|
5
5
|
export declare const INITIAL_DC: DC;
|
|
6
6
|
export declare const LAYER = 167;
|
|
7
|
-
export declare const APP_VERSION = "MTKruto 0.1.
|
|
7
|
+
export declare const APP_VERSION = "MTKruto 0.1.131";
|
|
8
8
|
export declare const DEVICE_MODEL: string;
|
|
9
9
|
export declare const LANG_CODE: string;
|
|
10
10
|
export declare const LANG_PACK = "";
|
package/esm/4_constants.js
CHANGED
|
@@ -53,7 +53,7 @@ export const PUBLIC_KEYS = Object.freeze([
|
|
|
53
53
|
]);
|
|
54
54
|
export const INITIAL_DC = "2";
|
|
55
55
|
export const LAYER = 167;
|
|
56
|
-
export const APP_VERSION = "MTKruto 0.1.
|
|
56
|
+
export const APP_VERSION = "MTKruto 0.1.131";
|
|
57
57
|
// @ts-ignore: lib
|
|
58
58
|
export const 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;
|
|
59
59
|
export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
package/esm/client/3_types.d.ts
CHANGED
|
@@ -242,7 +242,7 @@ export interface DeleteMessageParams {
|
|
|
242
242
|
onlyForMe?: boolean;
|
|
243
243
|
}
|
|
244
244
|
export interface SendPhotoParams {
|
|
245
|
-
/** The file name to assign. */
|
|
245
|
+
/** The file name to assign if applicable. */
|
|
246
246
|
fileName?: string;
|
|
247
247
|
/** Size of each upload chunk in bytes. */
|
|
248
248
|
chunkSize?: number;
|
|
@@ -335,6 +335,367 @@ export interface SendDocumentParams {
|
|
|
335
335
|
*/
|
|
336
336
|
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
337
337
|
}
|
|
338
|
+
export interface SendVideoParams {
|
|
339
|
+
/** The duration of the video in seconds. */
|
|
340
|
+
duration?: number;
|
|
341
|
+
width?: number;
|
|
342
|
+
height?: number;
|
|
343
|
+
supportsStreaming?: boolean;
|
|
344
|
+
/** The file name to assign if applicable. */
|
|
345
|
+
fileName?: string;
|
|
346
|
+
/** The mime type to assign. */
|
|
347
|
+
mimeType?: string;
|
|
348
|
+
/** Size of each upload chunk in bytes. */
|
|
349
|
+
chunkSize?: number;
|
|
350
|
+
/** Upload abort signal. */
|
|
351
|
+
signal?: AbortSignal | null;
|
|
352
|
+
/** The caption of the document. */
|
|
353
|
+
caption?: string;
|
|
354
|
+
/**
|
|
355
|
+
* The caption's entities.
|
|
356
|
+
*/
|
|
357
|
+
captionEntities?: MessageEntity[];
|
|
358
|
+
/**
|
|
359
|
+
* The parse mode to use for the caption. If not provided, the default parse mode will be used.
|
|
360
|
+
*/
|
|
361
|
+
parseMode?: ParseMode;
|
|
362
|
+
/**
|
|
363
|
+
* Whether to mark the video as a spoiler.
|
|
364
|
+
*/
|
|
365
|
+
hasSpoiler?: boolean;
|
|
366
|
+
/**
|
|
367
|
+
* Whether to send the message in a silent way without making a sound on the recipients' clients.
|
|
368
|
+
*/
|
|
369
|
+
disableNotification?: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Whether to protect the contents of the message from copying and forwarding.
|
|
372
|
+
*/
|
|
373
|
+
protectContent?: boolean;
|
|
374
|
+
/**
|
|
375
|
+
* The identifier of a message to reply to.
|
|
376
|
+
*/
|
|
377
|
+
replyToMessageId?: number;
|
|
378
|
+
/**
|
|
379
|
+
* The identifier of a thread to send the message to.
|
|
380
|
+
*/
|
|
381
|
+
messageThreadId?: number;
|
|
382
|
+
/**
|
|
383
|
+
* The identifier of the chat to send the message on behalf of. User-only.
|
|
384
|
+
*/
|
|
385
|
+
sendAs?: ChatID;
|
|
386
|
+
/**
|
|
387
|
+
* The reply markup of the message. Bot-only.
|
|
388
|
+
*/
|
|
389
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
390
|
+
}
|
|
391
|
+
export interface SendAnimationParams {
|
|
392
|
+
/** The duration of the animation in seconds. */
|
|
393
|
+
duration?: number;
|
|
394
|
+
width?: number;
|
|
395
|
+
height?: number;
|
|
396
|
+
/** The file name to assign if applicable. */
|
|
397
|
+
fileName?: string;
|
|
398
|
+
/** The mime type to assign. */
|
|
399
|
+
mimeType?: string;
|
|
400
|
+
/** Size of each upload chunk in bytes. */
|
|
401
|
+
chunkSize?: number;
|
|
402
|
+
/** Upload abort signal. */
|
|
403
|
+
signal?: AbortSignal | null;
|
|
404
|
+
/** The caption of the document. */
|
|
405
|
+
caption?: string;
|
|
406
|
+
/**
|
|
407
|
+
* The caption's entities.
|
|
408
|
+
*/
|
|
409
|
+
captionEntities?: MessageEntity[];
|
|
410
|
+
/**
|
|
411
|
+
* The parse mode to use for the caption. If not provided, the default parse mode will be used.
|
|
412
|
+
*/
|
|
413
|
+
parseMode?: ParseMode;
|
|
414
|
+
/**
|
|
415
|
+
* Whether to mark the animation as a spoiler.
|
|
416
|
+
*/
|
|
417
|
+
hasSpoiler?: boolean;
|
|
418
|
+
/**
|
|
419
|
+
* Whether to send the message in a silent way without making a sound on the recipients' clients.
|
|
420
|
+
*/
|
|
421
|
+
disableNotification?: boolean;
|
|
422
|
+
/**
|
|
423
|
+
* Whether to protect the contents of the message from copying and forwarding.
|
|
424
|
+
*/
|
|
425
|
+
protectContent?: boolean;
|
|
426
|
+
/**
|
|
427
|
+
* The identifier of a message to reply to.
|
|
428
|
+
*/
|
|
429
|
+
replyToMessageId?: number;
|
|
430
|
+
/**
|
|
431
|
+
* The identifier of a thread to send the message to.
|
|
432
|
+
*/
|
|
433
|
+
messageThreadId?: number;
|
|
434
|
+
/**
|
|
435
|
+
* The identifier of the chat to send the message on behalf of. User-only.
|
|
436
|
+
*/
|
|
437
|
+
sendAs?: ChatID;
|
|
438
|
+
/**
|
|
439
|
+
* The reply markup of the message. Bot-only.
|
|
440
|
+
*/
|
|
441
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
442
|
+
}
|
|
443
|
+
export interface SendVoiceParams {
|
|
444
|
+
/** The duration of the voice message in seconds. */
|
|
445
|
+
duration?: number;
|
|
446
|
+
/** The file name to assign if applicable. */
|
|
447
|
+
fileName?: string;
|
|
448
|
+
/** The mime type to assign. */
|
|
449
|
+
mimeType?: string;
|
|
450
|
+
/** Size of each upload chunk in bytes. */
|
|
451
|
+
chunkSize?: number;
|
|
452
|
+
/** Upload abort signal. */
|
|
453
|
+
signal?: AbortSignal | null;
|
|
454
|
+
/** The caption of the document. */
|
|
455
|
+
caption?: string;
|
|
456
|
+
/**
|
|
457
|
+
* The caption's entities.
|
|
458
|
+
*/
|
|
459
|
+
captionEntities?: MessageEntity[];
|
|
460
|
+
/**
|
|
461
|
+
* The parse mode to use for the caption. If not provided, the default parse mode will be used.
|
|
462
|
+
*/
|
|
463
|
+
parseMode?: ParseMode;
|
|
464
|
+
/**
|
|
465
|
+
* Whether to send the message in a silent way without making a sound on the recipients' clients.
|
|
466
|
+
*/
|
|
467
|
+
disableNotification?: boolean;
|
|
468
|
+
/**
|
|
469
|
+
* Whether to protect the contents of the message from copying and forwarding.
|
|
470
|
+
*/
|
|
471
|
+
protectContent?: boolean;
|
|
472
|
+
/**
|
|
473
|
+
* The identifier of a message to reply to.
|
|
474
|
+
*/
|
|
475
|
+
replyToMessageId?: number;
|
|
476
|
+
/**
|
|
477
|
+
* The identifier of a thread to send the message to.
|
|
478
|
+
*/
|
|
479
|
+
messageThreadId?: number;
|
|
480
|
+
/**
|
|
481
|
+
* The identifier of the chat to send the message on behalf of. User-only.
|
|
482
|
+
*/
|
|
483
|
+
sendAs?: ChatID;
|
|
484
|
+
/**
|
|
485
|
+
* The reply markup of the message. Bot-only.
|
|
486
|
+
*/
|
|
487
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
488
|
+
}
|
|
489
|
+
export interface SendAudioParams {
|
|
490
|
+
/** The duration of the audio file in seconds. */
|
|
491
|
+
duration?: number;
|
|
492
|
+
performer?: string;
|
|
493
|
+
title?: string;
|
|
494
|
+
/** The file name to assign if applicable. */
|
|
495
|
+
fileName?: string;
|
|
496
|
+
/** The mime type to assign. */
|
|
497
|
+
mimeType?: string;
|
|
498
|
+
/** Size of each upload chunk in bytes. */
|
|
499
|
+
chunkSize?: number;
|
|
500
|
+
/** Upload abort signal. */
|
|
501
|
+
signal?: AbortSignal | null;
|
|
502
|
+
/** The caption of the document. */
|
|
503
|
+
caption?: string;
|
|
504
|
+
/**
|
|
505
|
+
* The caption's entities.
|
|
506
|
+
*/
|
|
507
|
+
captionEntities?: MessageEntity[];
|
|
508
|
+
/**
|
|
509
|
+
* The parse mode to use for the caption. If not provided, the default parse mode will be used.
|
|
510
|
+
*/
|
|
511
|
+
parseMode?: ParseMode;
|
|
512
|
+
/**
|
|
513
|
+
* Whether to send the message in a silent way without making a sound on the recipients' clients.
|
|
514
|
+
*/
|
|
515
|
+
disableNotification?: boolean;
|
|
516
|
+
/**
|
|
517
|
+
* Whether to protect the contents of the message from copying and forwarding.
|
|
518
|
+
*/
|
|
519
|
+
protectContent?: boolean;
|
|
520
|
+
/**
|
|
521
|
+
* The identifier of a message to reply to.
|
|
522
|
+
*/
|
|
523
|
+
replyToMessageId?: number;
|
|
524
|
+
/**
|
|
525
|
+
* The identifier of a thread to send the message to.
|
|
526
|
+
*/
|
|
527
|
+
messageThreadId?: number;
|
|
528
|
+
/**
|
|
529
|
+
* The identifier of the chat to send the message on behalf of. User-only.
|
|
530
|
+
*/
|
|
531
|
+
sendAs?: ChatID;
|
|
532
|
+
/**
|
|
533
|
+
* The reply markup of the message. Bot-only.
|
|
534
|
+
*/
|
|
535
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
536
|
+
}
|
|
537
|
+
export interface SendVideoNoteParams {
|
|
538
|
+
/** The duration of the video note in seconds. */
|
|
539
|
+
duration?: number;
|
|
540
|
+
length?: number;
|
|
541
|
+
/** The file name to assign if applicable. */
|
|
542
|
+
fileName?: string;
|
|
543
|
+
/** The mime type to assign. */
|
|
544
|
+
mimeType?: string;
|
|
545
|
+
/** Size of each upload chunk in bytes. */
|
|
546
|
+
chunkSize?: number;
|
|
547
|
+
/** Upload abort signal. */
|
|
548
|
+
signal?: AbortSignal | null;
|
|
549
|
+
/** The caption of the document. */
|
|
550
|
+
caption?: string;
|
|
551
|
+
/**
|
|
552
|
+
* The caption's entities.
|
|
553
|
+
*/
|
|
554
|
+
captionEntities?: MessageEntity[];
|
|
555
|
+
/**
|
|
556
|
+
* The parse mode to use for the caption. If not provided, the default parse mode will be used.
|
|
557
|
+
*/
|
|
558
|
+
parseMode?: ParseMode;
|
|
559
|
+
/**
|
|
560
|
+
* Whether to send the message in a silent way without making a sound on the recipients' clients.
|
|
561
|
+
*/
|
|
562
|
+
disableNotification?: boolean;
|
|
563
|
+
/**
|
|
564
|
+
* Whether to protect the contents of the message from copying and forwarding.
|
|
565
|
+
*/
|
|
566
|
+
protectContent?: boolean;
|
|
567
|
+
/**
|
|
568
|
+
* The identifier of a message to reply to.
|
|
569
|
+
*/
|
|
570
|
+
replyToMessageId?: number;
|
|
571
|
+
/**
|
|
572
|
+
* The identifier of a thread to send the message to.
|
|
573
|
+
*/
|
|
574
|
+
messageThreadId?: number;
|
|
575
|
+
/**
|
|
576
|
+
* The identifier of the chat to send the message on behalf of. User-only.
|
|
577
|
+
*/
|
|
578
|
+
sendAs?: ChatID;
|
|
579
|
+
/**
|
|
580
|
+
* The reply markup of the message. Bot-only.
|
|
581
|
+
*/
|
|
582
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
583
|
+
}
|
|
584
|
+
export interface SendLocationParams {
|
|
585
|
+
horizontalAccuracy?: number;
|
|
586
|
+
livePeriod?: number;
|
|
587
|
+
heading?: number;
|
|
588
|
+
proximityAlertRadius?: number;
|
|
589
|
+
/**
|
|
590
|
+
* Whether to send the message in a silent way without making a sound on the recipients' clients.
|
|
591
|
+
*/
|
|
592
|
+
disableNotification?: boolean;
|
|
593
|
+
/**
|
|
594
|
+
* Whether to protect the contents of the message from copying and forwarding.
|
|
595
|
+
*/
|
|
596
|
+
protectContent?: boolean;
|
|
597
|
+
/**
|
|
598
|
+
* The identifier of a message to reply to.
|
|
599
|
+
*/
|
|
600
|
+
replyToMessageId?: number;
|
|
601
|
+
/**
|
|
602
|
+
* The identifier of a thread to send the message to.
|
|
603
|
+
*/
|
|
604
|
+
messageThreadId?: number;
|
|
605
|
+
/**
|
|
606
|
+
* The identifier of the chat to send the message on behalf of. User-only.
|
|
607
|
+
*/
|
|
608
|
+
sendAs?: ChatID;
|
|
609
|
+
/**
|
|
610
|
+
* The reply markup of the message. Bot-only.
|
|
611
|
+
*/
|
|
612
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
613
|
+
}
|
|
614
|
+
export interface SendVenueParams {
|
|
615
|
+
foursquareId?: string;
|
|
616
|
+
foursquareType?: string;
|
|
617
|
+
/**
|
|
618
|
+
* Whether to send the message in a silent way without making a sound on the recipients' clients.
|
|
619
|
+
*/
|
|
620
|
+
disableNotification?: boolean;
|
|
621
|
+
/**
|
|
622
|
+
* Whether to protect the contents of the message from copying and forwarding.
|
|
623
|
+
*/
|
|
624
|
+
protectContent?: boolean;
|
|
625
|
+
/**
|
|
626
|
+
* The identifier of a message to reply to.
|
|
627
|
+
*/
|
|
628
|
+
replyToMessageId?: number;
|
|
629
|
+
/**
|
|
630
|
+
* The identifier of a thread to send the message to.
|
|
631
|
+
*/
|
|
632
|
+
messageThreadId?: number;
|
|
633
|
+
/**
|
|
634
|
+
* The identifier of the chat to send the message on behalf of. User-only.
|
|
635
|
+
*/
|
|
636
|
+
sendAs?: ChatID;
|
|
637
|
+
/**
|
|
638
|
+
* The reply markup of the message. Bot-only.
|
|
639
|
+
*/
|
|
640
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
641
|
+
}
|
|
642
|
+
export interface SendContactParams {
|
|
643
|
+
/** The contact's last name. */
|
|
644
|
+
lastName?: string;
|
|
645
|
+
/** Additional information in the vCard format. */
|
|
646
|
+
vcard?: string;
|
|
647
|
+
/**
|
|
648
|
+
* Whether to send the message in a silent way without making a sound on the recipients' clients.
|
|
649
|
+
*/
|
|
650
|
+
disableNotification?: boolean;
|
|
651
|
+
/**
|
|
652
|
+
* Whether to protect the contents of the message from copying and forwarding.
|
|
653
|
+
*/
|
|
654
|
+
protectContent?: boolean;
|
|
655
|
+
/**
|
|
656
|
+
* The identifier of a message to reply to.
|
|
657
|
+
*/
|
|
658
|
+
replyToMessageId?: number;
|
|
659
|
+
/**
|
|
660
|
+
* The identifier of a thread to send the message to.
|
|
661
|
+
*/
|
|
662
|
+
messageThreadId?: number;
|
|
663
|
+
/**
|
|
664
|
+
* The identifier of the chat to send the message on behalf of. User-only.
|
|
665
|
+
*/
|
|
666
|
+
sendAs?: ChatID;
|
|
667
|
+
/**
|
|
668
|
+
* The reply markup of the message. Bot-only.
|
|
669
|
+
*/
|
|
670
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
671
|
+
}
|
|
672
|
+
export interface SendDiceParams {
|
|
673
|
+
emoji?: "🎲" | "🎯" | "🏀" | "⚽" | "🎳" | "🎰";
|
|
674
|
+
/**
|
|
675
|
+
* Whether to send the message in a silent way without making a sound on the recipients' clients.
|
|
676
|
+
*/
|
|
677
|
+
disableNotification?: boolean;
|
|
678
|
+
/**
|
|
679
|
+
* Whether to protect the contents of the message from copying and forwarding.
|
|
680
|
+
*/
|
|
681
|
+
protectContent?: boolean;
|
|
682
|
+
/**
|
|
683
|
+
* The identifier of a message to reply to.
|
|
684
|
+
*/
|
|
685
|
+
replyToMessageId?: number;
|
|
686
|
+
/**
|
|
687
|
+
* The identifier of a thread to send the message to.
|
|
688
|
+
*/
|
|
689
|
+
messageThreadId?: number;
|
|
690
|
+
/**
|
|
691
|
+
* The identifier of the chat to send the message on behalf of. User-only.
|
|
692
|
+
*/
|
|
693
|
+
sendAs?: ChatID;
|
|
694
|
+
/**
|
|
695
|
+
* The reply markup of the message. Bot-only.
|
|
696
|
+
*/
|
|
697
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
698
|
+
}
|
|
338
699
|
export type ConnectionState = "notConnected" | "updating" | "ready";
|
|
339
700
|
export type AuthorizationState = {
|
|
340
701
|
authorized: boolean;
|
|
@@ -391,11 +752,10 @@ export interface NetworkStatistics {
|
|
|
391
752
|
messages: NetworkStatisticsEntry;
|
|
392
753
|
cdn: NetworkStatisticsEntry;
|
|
393
754
|
}
|
|
394
|
-
export type ChatList = "main" | "archived";
|
|
395
755
|
export declare function getChatListId(chatList: string): 0 | 1;
|
|
396
756
|
export interface GetChatsParams {
|
|
397
757
|
/** The chat list to get the chats from. Defaults to main. */
|
|
398
|
-
from?:
|
|
758
|
+
from?: "main" | "archived";
|
|
399
759
|
/** The last chat to get chats after. */
|
|
400
760
|
after?: Chat;
|
|
401
761
|
/** The maximum number of results to return. Must be in the range of 1-100. Defaults to 100. */
|
package/esm/client/5_client.d.ts
CHANGED
|
@@ -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, CallbackQuery, Chat, ChatAction, ChatID, InlineQuery, InlineQueryResult, Message, ParseMode, User } from "../3_types.js";
|
|
5
|
+
import { BotCommand, CallbackQuery, Chat, ChatAction, ChatID, Document, InlineQuery, InlineQueryResult, Message, ParseMode, User } from "../3_types.js";
|
|
6
6
|
import { Migrate } from "../4_errors.js";
|
|
7
7
|
import { FileSource, With } from "./0_utilities.js";
|
|
8
8
|
import { ClientAbstract } from "./1_client_abstract.js";
|
|
9
|
-
import { AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, ClientParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageParams, FilterableUpdates, FilterUpdate, ForwardMessagesParams, GetChatsParams, GetHistoryParams, GetMyCommandsParams, InvokeErrorHandler, NetworkStatistics, ReplyParams, SendDocumentParams, SendMessageParams, SendPhotoParams, SendPollParams, SetMyCommandsParams, Update, UploadParams } from "./3_types.js";
|
|
9
|
+
import { AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, ClientParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageParams, FilterableUpdates, FilterUpdate, ForwardMessagesParams, GetChatsParams, GetHistoryParams, GetMyCommandsParams, InvokeErrorHandler, NetworkStatistics, ReplyParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetMyCommandsParams, Update, UploadParams } from "./3_types.js";
|
|
10
10
|
import { Composer, Middleware } from "./4_composer.js";
|
|
11
11
|
declare const getEntity: unique symbol;
|
|
12
12
|
declare const getStickerSetName: unique symbol;
|
|
@@ -45,6 +45,24 @@ export interface Context extends Update {
|
|
|
45
45
|
replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyToMessageId"> & ReplyParams) => Promise<With<Message, "photo">>;
|
|
46
46
|
/** Reply the received message with a document. */
|
|
47
47
|
replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyToMessageId"> & ReplyParams) => Promise<With<Message, "document">>;
|
|
48
|
+
/** Reply the received message with a location. */
|
|
49
|
+
replyLocation: (latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyToMessageId"> & ReplyParams) => Promise<With<Message, "location">>;
|
|
50
|
+
/** Reply the received message with a dice. */
|
|
51
|
+
replyDice: (params?: Omit<SendDiceParams, "replyToMessageId"> & ReplyParams) => Promise<With<Message, "dice">>;
|
|
52
|
+
/** Reply the received message with a venue. */
|
|
53
|
+
replyVenue: (latitude: number, longitude: number, title: string, address: string, params?: Omit<SendVenueParams, "replyToMessageId"> & ReplyParams) => Promise<With<Message, "venue">>;
|
|
54
|
+
/** Reply the received message with a contact. */
|
|
55
|
+
replyContact: (firstName: string, number: string, params?: Omit<SendContactParams, "replyToMessageId"> & ReplyParams) => Promise<With<Message, "contact">>;
|
|
56
|
+
/** Reply the received message with a video. */
|
|
57
|
+
replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyToMessageId"> & ReplyParams) => Promise<With<Message, "video">>;
|
|
58
|
+
/** Reply the received message with an animation. */
|
|
59
|
+
replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyToMessageId"> & ReplyParams) => Promise<With<Message, "animation">>;
|
|
60
|
+
/** Reply the received message with a voice message. */
|
|
61
|
+
replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyToMessageId"> & ReplyParams) => Promise<With<Message, "voice">>;
|
|
62
|
+
/** Reply the received message with an audio file. */
|
|
63
|
+
replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyToMessageId"> & ReplyParams) => Promise<With<Message, "audio">>;
|
|
64
|
+
/** Reply the received message with a video note. */
|
|
65
|
+
replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyToMessageId"> & ReplyParams) => Promise<With<Message, "videoNote">>;
|
|
48
66
|
/** Delete the received message. */
|
|
49
67
|
delete: () => Promise<void>;
|
|
50
68
|
/** Forward the received message. */
|
|
@@ -157,6 +175,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
157
175
|
private [getEntity];
|
|
158
176
|
private [getEntity];
|
|
159
177
|
private [getEntity];
|
|
178
|
+
private [getEntity];
|
|
160
179
|
processResult(result: ReadObject): Promise<void>;
|
|
161
180
|
/**
|
|
162
181
|
* Send a text message.
|
|
@@ -214,7 +233,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
214
233
|
* ```
|
|
215
234
|
* @returns A generator yielding the contents of the file.
|
|
216
235
|
*/
|
|
217
|
-
download(fileId: string, params?: DownloadParams):
|
|
236
|
+
download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
|
|
218
237
|
private [getStickerSetName];
|
|
219
238
|
/**
|
|
220
239
|
* Forward multiple messages.
|
|
@@ -388,6 +407,82 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
388
407
|
* @param document The document to send.
|
|
389
408
|
*/
|
|
390
409
|
sendDocument(chatId: ChatID, document: FileSource, params?: SendDocumentParams): Promise<With<Message, "document">>;
|
|
410
|
+
/**
|
|
411
|
+
* Send a video.
|
|
412
|
+
*
|
|
413
|
+
* @method
|
|
414
|
+
* @param chatId The chat to send the video to.
|
|
415
|
+
* @param video The video to send.
|
|
416
|
+
*/
|
|
417
|
+
sendVideo(chatId: ChatID, video: FileSource, params?: SendVideoParams): Promise<With<Message, "video">>;
|
|
418
|
+
/**
|
|
419
|
+
* Send an animation.
|
|
420
|
+
*
|
|
421
|
+
* @method
|
|
422
|
+
* @param chatId The chat to send the animation to.
|
|
423
|
+
* @param animation The animation to send.
|
|
424
|
+
*/
|
|
425
|
+
sendAnimation(chatId: ChatID, animation: FileSource, params?: SendAnimationParams): Promise<With<Message, "animation">>;
|
|
426
|
+
/**
|
|
427
|
+
* Send a voice message.
|
|
428
|
+
*
|
|
429
|
+
* @method
|
|
430
|
+
* @param chatId The chat to send the voice message to.
|
|
431
|
+
* @param voice The voice to send.
|
|
432
|
+
*/
|
|
433
|
+
sendVoice(chatId: ChatID, voice: FileSource, params?: SendVoiceParams): Promise<With<Message, "voice">>;
|
|
434
|
+
/**
|
|
435
|
+
* Send an audio file.
|
|
436
|
+
*
|
|
437
|
+
* @method
|
|
438
|
+
* @param chatId The chat to send the audio file to.
|
|
439
|
+
* @param audio The audio to send.
|
|
440
|
+
*/
|
|
441
|
+
sendAudio(chatId: ChatID, audio: FileSource, params?: SendAudioParams): Promise<With<Message, "audio">>;
|
|
442
|
+
/**
|
|
443
|
+
* Send a video note.
|
|
444
|
+
*
|
|
445
|
+
* @method
|
|
446
|
+
* @param chatId The chat to send the video note to.
|
|
447
|
+
* @param videoNote The video note to send.
|
|
448
|
+
*/
|
|
449
|
+
sendVideoNote(chatId: ChatID, audio: FileSource, params?: SendVideoNoteParams): Promise<With<Message, "videoNote">>;
|
|
450
|
+
/**
|
|
451
|
+
* Send a location.
|
|
452
|
+
*
|
|
453
|
+
* @method
|
|
454
|
+
* @param chatId The chat to send the location to.
|
|
455
|
+
* @param latitude The location's latitude.
|
|
456
|
+
* @param longitude The location's longitude.
|
|
457
|
+
*/
|
|
458
|
+
sendLocation(chatId: ChatID, latitude: number, longitude: number, params?: SendLocationParams): Promise<With<Message, "location">>;
|
|
459
|
+
/**
|
|
460
|
+
* Send a contact.
|
|
461
|
+
*
|
|
462
|
+
* @method
|
|
463
|
+
* @param chatId The chat to send the contact to.
|
|
464
|
+
* @param firstName The contact's first name.
|
|
465
|
+
* @param number The contact's phone number.
|
|
466
|
+
*/
|
|
467
|
+
sendContact(chatId: ChatID, firstName: string, number: string, params?: SendContactParams): Promise<With<Message, "contact">>;
|
|
468
|
+
/**
|
|
469
|
+
* Send a dice.
|
|
470
|
+
*
|
|
471
|
+
* @method
|
|
472
|
+
* @param chatId The chat to send the dice to.
|
|
473
|
+
*/
|
|
474
|
+
sendDice(chatId: ChatID, params?: SendDiceParams): Promise<With<Message, "dice">>;
|
|
475
|
+
/**
|
|
476
|
+
* Send a venue.
|
|
477
|
+
*
|
|
478
|
+
* @method
|
|
479
|
+
* @param chatId The chat to send the venue to.
|
|
480
|
+
* @param latitude The latitude of the venue.
|
|
481
|
+
* @param longitude The longitude of the venue.
|
|
482
|
+
* @param title The title of the venue.
|
|
483
|
+
* @param address The written address of the venue.
|
|
484
|
+
*/
|
|
485
|
+
sendVenue(chatId: ChatID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<With<Message, "dice">>;
|
|
391
486
|
/**
|
|
392
487
|
* Get network statistics. This might not always be available.
|
|
393
488
|
*
|
|
@@ -395,17 +490,30 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
395
490
|
*/
|
|
396
491
|
getNetworkStatistics(): Promise<NetworkStatistics>;
|
|
397
492
|
/**
|
|
398
|
-
* Get chats.
|
|
493
|
+
* Get chats from a chat list. User-only.
|
|
399
494
|
*
|
|
400
495
|
* @method
|
|
401
496
|
*/
|
|
402
497
|
getChats(params?: GetChatsParams): Promise<Chat[]>;
|
|
403
498
|
/**
|
|
404
|
-
* Get chat
|
|
499
|
+
* Get a chat.
|
|
500
|
+
*
|
|
501
|
+
* @method
|
|
502
|
+
*/
|
|
503
|
+
getChat(chatId: ChatID): Promise<Chat>;
|
|
504
|
+
/**
|
|
505
|
+
* Get chat history. User-only.
|
|
405
506
|
*
|
|
406
507
|
* @param chatId The identifier of the chat to get its history.
|
|
407
508
|
* @method
|
|
408
509
|
*/
|
|
409
510
|
getHistory(chatId: ChatID, params?: GetHistoryParams): Promise<Message[]>;
|
|
511
|
+
/**
|
|
512
|
+
* Get custom emoji documents for download.
|
|
513
|
+
*
|
|
514
|
+
* @param id Identifier of one or more of custom emojis.
|
|
515
|
+
* @method
|
|
516
|
+
*/
|
|
517
|
+
getCustomEmojiDocuments(id: string | string[]): Promise<Document[]>;
|
|
410
518
|
}
|
|
411
519
|
export {};
|