@mtkruto/node 0.0.999 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/0_deps.d.ts +1 -1
- package/esm/0_deps.js +1 -1
- package/esm/3_errors.d.ts +1531 -0
- package/esm/3_errors.js +1531 -0
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/4_errors.d.ts +25 -0
- package/esm/4_errors.js +64 -0
- package/esm/client/2_client_plain.js +1 -1
- package/esm/client/4_client.d.ts +2 -1
- package/esm/client/4_client.js +24 -41
- package/esm/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.d.ts +2 -2
- package/esm/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.js +19 -6
- package/esm/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.d.ts +2 -0
- package/esm/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.js +991 -0
- package/esm/mod.d.ts +3 -2
- package/esm/mod.js +3 -2
- package/esm/tl/2_types.d.ts +1 -1
- package/esm/tl/2_types.js +1 -2
- package/esm/tl/3_functions.d.ts +1 -1
- package/esm/tl/3_functions.js +1 -2
- package/esm/types/0__file_id.js +0 -1
- package/esm/types/1_bot_command_scope.d.ts +1 -1
- package/esm/types/1_bot_command_scope.js +1 -1
- package/esm/types/1_chat.d.ts +1 -1
- package/esm/types/1_chat.js +1 -1
- package/esm/types/1_sticker.d.ts +1 -1
- package/esm/types/1_sticker.js +1 -1
- package/esm/types/1_user.d.ts +1 -1
- package/esm/types/1_user.js +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +1 -1
- package/esm/types/3_message.d.ts +12 -12
- package/esm/types/3_message.js +12 -12
- package/esm/types/5_inline_query_result.d.ts +1 -1
- package/esm/types/5_inline_query_result.js +1 -1
- package/esm/utilities/0_crypto.js +6 -4
- package/package.json +1 -1
- package/script/0_deps.d.ts +1 -1
- package/script/0_deps.js +1 -1
- package/script/3_errors.d.ts +1531 -0
- package/script/3_errors.js +2053 -0
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/4_errors.d.ts +25 -0
- package/script/4_errors.js +88 -0
- package/script/client/2_client_plain.js +1 -1
- package/script/client/4_client.d.ts +2 -1
- package/script/client/4_client.js +24 -41
- package/script/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.d.ts +2 -2
- package/script/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.2.1}/mod.js +19 -6
- package/script/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.d.ts +2 -0
- package/script/deps/deno.land/x/tgcrypto@0.2.1/tgcrypto.js +993 -0
- package/script/mod.d.ts +3 -2
- package/script/mod.js +16 -3
- package/script/tl/2_types.d.ts +1 -1
- package/script/tl/2_types.js +0 -1
- package/script/tl/3_functions.d.ts +1 -1
- package/script/tl/3_functions.js +0 -1
- package/script/types/0__file_id.js +0 -1
- package/script/types/1_bot_command_scope.d.ts +1 -1
- package/script/types/1_bot_command_scope.js +1 -1
- package/script/types/1_chat.d.ts +1 -1
- package/script/types/1_chat.js +1 -1
- package/script/types/1_sticker.d.ts +1 -1
- package/script/types/1_sticker.js +1 -1
- package/script/types/1_user.d.ts +1 -1
- package/script/types/1_user.js +1 -1
- package/script/types/2_inline_keyboard_button.d.ts +1 -1
- package/script/types/3_message.d.ts +12 -12
- package/script/types/3_message.js +12 -12
- package/script/types/5_inline_query_result.d.ts +1 -1
- package/script/types/5_inline_query_result.js +1 -1
- package/script/utilities/0_crypto.js +6 -4
- package/esm/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -2
- package/esm/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.js +0 -1078
- package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -2
- package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.js +0 -1080
package/script/mod.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ export declare const utils: {
|
|
|
4
4
|
checkPassword: typeof checkPassword;
|
|
5
5
|
getRandomId: typeof getRandomId;
|
|
6
6
|
};
|
|
7
|
-
export * from "./2_tl.js";
|
|
8
7
|
export * from "./2_connection.js";
|
|
9
8
|
export * from "./3_storage.js";
|
|
10
9
|
export * from "./3_transport.js";
|
|
10
|
+
export * from "./2_tl.js";
|
|
11
|
+
export * from "./3_types.js";
|
|
11
12
|
export { APP_VERSION, DEVICE_MODEL, INITIAL_DC, LANG_CODE, LANG_PACK, LAYER, SYSTEM_LANG_CODE, SYSTEM_VERSION } from "./4_constants.js";
|
|
13
|
+
export * as errors from "./4_errors.js";
|
|
12
14
|
export * from "./5_client.js";
|
|
13
|
-
export * from "./3_types.js";
|
package/script/mod.js
CHANGED
|
@@ -10,18 +10,31 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
13
18
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
20
|
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
16
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LAYER = exports.LANG_PACK = exports.LANG_CODE = exports.INITIAL_DC = exports.DEVICE_MODEL = exports.APP_VERSION = exports.utils = void 0;
|
|
29
|
+
exports.errors = exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LAYER = exports.LANG_PACK = exports.LANG_CODE = exports.INITIAL_DC = exports.DEVICE_MODEL = exports.APP_VERSION = exports.utils = void 0;
|
|
18
30
|
const _1_utilities_js_1 = require("./1_utilities.js");
|
|
19
31
|
const _0_password_js_1 = require("./client/0_password.js");
|
|
20
32
|
exports.utils = { checkPassword: _0_password_js_1.checkPassword, getRandomId: _1_utilities_js_1.getRandomId };
|
|
21
|
-
__exportStar(require("./2_tl.js"), exports);
|
|
22
33
|
__exportStar(require("./2_connection.js"), exports);
|
|
23
34
|
__exportStar(require("./3_storage.js"), exports);
|
|
24
35
|
__exportStar(require("./3_transport.js"), exports);
|
|
36
|
+
__exportStar(require("./2_tl.js"), exports);
|
|
37
|
+
__exportStar(require("./3_types.js"), exports);
|
|
25
38
|
var _4_constants_js_1 = require("./4_constants.js");
|
|
26
39
|
Object.defineProperty(exports, "APP_VERSION", { enumerable: true, get: function () { return _4_constants_js_1.APP_VERSION; } });
|
|
27
40
|
Object.defineProperty(exports, "DEVICE_MODEL", { enumerable: true, get: function () { return _4_constants_js_1.DEVICE_MODEL; } });
|
|
@@ -31,5 +44,5 @@ Object.defineProperty(exports, "LANG_PACK", { enumerable: true, get: function ()
|
|
|
31
44
|
Object.defineProperty(exports, "LAYER", { enumerable: true, get: function () { return _4_constants_js_1.LAYER; } });
|
|
32
45
|
Object.defineProperty(exports, "SYSTEM_LANG_CODE", { enumerable: true, get: function () { return _4_constants_js_1.SYSTEM_LANG_CODE; } });
|
|
33
46
|
Object.defineProperty(exports, "SYSTEM_VERSION", { enumerable: true, get: function () { return _4_constants_js_1.SYSTEM_VERSION; } });
|
|
47
|
+
exports.errors = __importStar(require("./4_errors.js"));
|
|
34
48
|
__exportStar(require("./5_client.js"), exports);
|
|
35
|
-
__exportStar(require("./3_types.js"), exports);
|
package/script/tl/2_types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { id,
|
|
1
|
+
import { id, ParamDesc, paramDesc, Params, params, TLObject, TLObjectConstructor } from "./1_tl_object.js";
|
|
2
2
|
export declare abstract class Type extends TLObject {
|
|
3
3
|
}
|
|
4
4
|
export declare abstract class TypeX extends Type {
|
package/script/tl/2_types.js
CHANGED
|
@@ -33,7 +33,6 @@ exports.AttachMenuBotIcon = exports.AttachMenuBotIconColor = exports.PhoneGroupC
|
|
|
33
33
|
exports.EmailVerificationGoogle = exports.EmailVerificationCode = exports.EmailVerifyPurposePassport = exports.EmailVerifyPurposeLoginChange = exports.EmailVerifyPurposeLoginSetup = exports.MessagesReactions = exports.MessagesReactionsNotModified = exports.ChatReactionsSome = exports.ChatReactionsAll = exports.ChatReactionsNone = exports.ReactionCustomEmoji = exports.ReactionEmoji = exports.ReactionEmpty = exports.AccountEmojiStatuses = exports.AccountEmojiStatusesNotModified = exports.EmojiStatusUntil = exports.EmojiStatus = exports.EmojiStatusEmpty = exports.PaymentFormMethod = exports.PremiumGiftOption = exports.InputStorePaymentGiftPremium = exports.InputStorePaymentPremiumSubscription = exports.HelpPremiumPromo = exports.MessagesTranscribedAudio = exports.PaymentsExportedInvoice = exports.InputInvoiceSlug = exports.InputInvoiceMessage = exports.AttachMenuPeerTypeBroadcast = exports.AttachMenuPeerTypeChat = exports.AttachMenuPeerTypePM = exports.AttachMenuPeerTypeBotPM = exports.AttachMenuPeerTypeSameBotPM = exports.AccountSavedRingtoneConverted = exports.AccountSavedRingtone = exports.NotificationSoundRingtone = exports.NotificationSoundLocal = exports.NotificationSoundNone = exports.NotificationSoundDefault = exports.AccountSavedRingtones = exports.AccountSavedRingtonesNotModified = exports.BotMenuButton = exports.BotMenuButtonCommands = exports.BotMenuButtonDefault = exports.WebViewMessageSent = exports.SimpleWebViewResultURL = exports.WebViewResultURL = exports.AttachMenuBotsBot = exports.AttachMenuBots = exports.AttachMenuBotsNotModified = exports.AttachMenuBot = void 0;
|
|
34
34
|
exports.StoryViews = exports.SponsoredWebPage = exports.MessagePeerVoteMultiple = exports.MessagePeerVoteInputOption = exports.MessagePeerVote = exports.BotsBotInfo = exports.ChatlistsChatlistUpdates = exports.ChatlistsChatlistInvite = exports.ChatlistsChatlistInviteAlready = exports.ChatlistsExportedInvites = exports.ChatlistsExportedChatlistInvite = exports.ExportedChatlistInvite = exports.InputChatlistDialogFilter = exports.ReadParticipantDate = exports.InlineBotWebView = exports.AppWebViewResultURL = exports.MessagesBotApp = exports.BotApp = exports.BotAppNotModified = exports.InputBotAppShortName = exports.InputBotAppID = exports.HelpAppConfig = exports.HelpAppConfigNotModified = exports.AccountAutoSaveSettings = exports.AutoSaveException = exports.AutoSaveSettings = exports.MessagesTranslateResult = exports.TextWithEntities = exports.MessagesEmojiGroups = exports.MessagesEmojiGroupsNotModified = exports.EmojiGroup = exports.EmojiList = exports.EmojiListNotModified = exports.RequestPeerTypeBroadcast = exports.RequestPeerTypeChat = exports.RequestPeerTypeUser = exports.ExportedContactToken = exports.DefaultHistoryTTL = exports.MessagesForumTopics = exports.ForumTopic = exports.ForumTopicDeleted = exports.Username = exports.StickerKeyword = exports.MessageExtendedMedia = exports.MessageExtendedMediaPreview = exports.SendAsPeer = exports.PremiumSubscriptionOption = exports.AccountEmailVerifiedLogin = exports.AccountEmailVerified = exports.EmailVerificationApple = void 0;
|
|
35
35
|
exports.map = exports.MediaAreaGeoPoint = exports.InputMediaAreaVenue = exports.MediaAreaVenue = exports.MediaAreaCoordinates = exports.StoriesStealthMode = exports.ExportedStoryLink = exports.InputReplyToStory = exports.InputReplyToMessage = exports.StoriesStoryViews = exports.StoriesStoryViewsList = exports.StoryView = exports.StoriesUserStories = exports.StoriesStories = exports.StoriesAllStories = exports.StoriesAllStoriesNotModified = exports.UserStories = exports.StoryItem = exports.StoryItemSkipped = exports.StoryItemDeleted = void 0;
|
|
36
|
-
// deno-fmt-ignore-file
|
|
37
36
|
const _1_tl_object_js_1 = require("./1_tl_object.js");
|
|
38
37
|
class Type extends _1_tl_object_js_1.TLObject {
|
|
39
38
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { id,
|
|
1
|
+
import { id, ParamDesc, paramDesc, Params, params, TLObject } from "./1_tl_object.js";
|
|
2
2
|
import * as types from "./2_types.js";
|
|
3
3
|
export declare abstract class Function<T> extends TLObject {
|
|
4
4
|
__R: T;
|
package/script/tl/3_functions.js
CHANGED
|
@@ -34,7 +34,6 @@ exports.ChannelsInviteToChannel = exports.ChannelsLeaveChannel = exports.Channel
|
|
|
34
34
|
exports.BotsGetBotInfo = exports.BotsSetBotInfo = exports.BotsSetBotGroupDefaultAdminRights = exports.BotsSetBotBroadcastDefaultAdminRights = exports.BotsGetBotMenuButton = exports.BotsSetBotMenuButton = exports.BotsGetBotCommands = exports.BotsResetBotCommands = exports.BotsSetBotCommands = exports.BotsAnswerWebhookJSONQuery = exports.BotsSendCustomRequest = exports.ChannelsClickSponsoredMessage = exports.ChannelsToggleParticipantsHidden = exports.ChannelsReportAntiSpamFalsePositive = exports.ChannelsToggleAntiSpam = exports.ChannelsReorderPinnedForumTopics = exports.ChannelsDeleteTopicHistory = exports.ChannelsUpdatePinnedForumTopic = exports.ChannelsEditForumTopic = exports.ChannelsGetForumTopicsByID = exports.ChannelsGetForumTopics = exports.ChannelsCreateForumTopic = exports.ChannelsToggleForum = exports.ChannelsDeactivateAllUsernames = exports.ChannelsToggleUsername = exports.ChannelsReorderUsernames = exports.ChannelsToggleJoinRequest = exports.ChannelsToggleJoinToSend = exports.ChannelsDeleteParticipantHistory = exports.ChannelsGetSendAs = exports.ChannelsGetSponsoredMessages = exports.ChannelsViewSponsoredMessage = exports.ChannelsConvertToGigagroup = exports.ChannelsGetInactiveChannels = exports.ChannelsToggleSlowMode = exports.ChannelsEditLocation = exports.ChannelsEditCreator = exports.ChannelsSetDiscussionGroup = exports.ChannelsGetGroupsForDiscussion = exports.ChannelsGetLeftChannels = exports.ChannelsTogglePreHistoryHidden = exports.ChannelsDeleteHistory = exports.ChannelsReadMessageContents = exports.ChannelsSetStickers = exports.ChannelsGetAdminLog = exports.ChannelsEditBanned = exports.ChannelsGetAdminedPublicChannels = exports.ChannelsToggleSignatures = exports.ChannelsExportMessageLink = exports.ChannelsDeleteChannel = void 0;
|
|
35
35
|
exports.PhoneJoinGroupCallPresentation = exports.PhoneSaveDefaultGroupCallJoinAs = exports.PhoneStartScheduledGroupCall = exports.PhoneToggleGroupCallStartSubscription = exports.PhoneExportGroupCallInvite = exports.PhoneGetGroupCallJoinAs = exports.PhoneEditGroupCallTitle = exports.PhoneEditGroupCallParticipant = exports.PhoneToggleGroupCallRecord = exports.PhoneCheckGroupCall = exports.PhoneGetGroupParticipants = exports.PhoneGetGroupCall = exports.PhoneToggleGroupCallSettings = exports.PhoneDiscardGroupCall = exports.PhoneInviteToGroupCall = exports.PhoneLeaveGroupCall = exports.PhoneJoinGroupCall = exports.PhoneCreateGroupCall = exports.PhoneSendSignalingData = exports.PhoneSaveCallDebug = exports.PhoneSetCallRating = exports.PhoneDiscardCall = exports.PhoneReceivedCall = exports.PhoneConfirmCall = exports.PhoneAcceptCall = exports.PhoneRequestCall = exports.PhoneGetCallConfig = exports.StickersDeleteStickerSet = exports.StickersRenameStickerSet = exports.StickersChangeSticker = exports.StickersSuggestShortName = exports.StickersCheckShortName = exports.StickersSetStickerSetThumb = exports.StickersAddStickerToSet = exports.StickersChangeStickerPosition = exports.StickersRemoveStickerFromSet = exports.StickersCreateStickerSet = exports.PaymentsCanPurchasePremium = exports.PaymentsAssignPlayMarketTransaction = exports.PaymentsAssignAppStoreTransaction = exports.PaymentsExportInvoice = exports.PaymentsGetBankCardData = exports.PaymentsClearSavedInfo = exports.PaymentsGetSavedInfo = exports.PaymentsSendPaymentForm = exports.PaymentsValidateRequestedInfo = exports.PaymentsGetPaymentReceipt = exports.PaymentsGetPaymentForm = exports.BotsToggleUsername = exports.BotsReorderUsernames = void 0;
|
|
36
36
|
exports.StoriesSendReaction = exports.StoriesActivateStealthMode = exports.StoriesReport = exports.StoriesExportStoryLink = exports.StoriesGetStoriesViews = exports.StoriesGetStoryViewsList = exports.StoriesIncrementStoryViews = exports.StoriesReadStories = exports.StoriesGetAllReadUserStories = exports.StoriesToggleAllStoriesHidden = exports.StoriesGetStoriesByID = exports.StoriesGetStoriesArchive = exports.StoriesGetPinnedStories = exports.StoriesGetUserStories = exports.StoriesGetAllStories = exports.StoriesTogglePinned = exports.StoriesDeleteStories = exports.StoriesEditStory = exports.StoriesSendStory = exports.ChatlistsLeaveChatlist = exports.ChatlistsGetLeaveChatlistSuggestions = exports.ChatlistsHideChatlistUpdates = exports.ChatlistsJoinChatlistUpdates = exports.ChatlistsGetChatlistUpdates = exports.ChatlistsJoinChatlistInvite = exports.ChatlistsCheckChatlistInvite = exports.ChatlistsGetExportedInvites = exports.ChatlistsEditExportedInvite = exports.ChatlistsDeleteExportedInvite = exports.ChatlistsExportChatlistInvite = exports.StatsGetMessageStats = exports.StatsGetMessagePublicForwards = exports.StatsGetMegagroupStats = exports.StatsLoadAsyncGraph = exports.StatsGetBroadcastStats = exports.FoldersEditPeerFolders = exports.LangpackGetLanguage = exports.LangpackGetLanguages = exports.LangpackGetDifference = exports.LangpackGetStrings = exports.LangpackGetLangPack = exports.PhoneSaveCallLog = exports.PhoneGetGroupCallStreamRtmpURL = exports.PhoneGetGroupCallStreamChannels = exports.PhoneLeaveGroupCallPresentation = void 0;
|
|
37
|
-
// deno-fmt-ignore-file
|
|
38
37
|
const _1_tl_object_js_1 = require("./1_tl_object.js");
|
|
39
38
|
const types = __importStar(require("./2_types.js"));
|
|
40
39
|
class Function extends _1_tl_object_js_1.TLObject {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FileUniqueID = exports.FileUniqueType = exports.FileID = exports.ThumbnailSource = exports.FileType = void 0;
|
|
4
|
-
// Direct port from Pyrogram
|
|
5
4
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
6
5
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
7
6
|
var FileType;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.botCommandScopeToTlObject = void 0;
|
|
4
|
-
const _2_tl_js_1 = require("../2_tl.js");
|
|
5
4
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
5
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
6
6
|
async function botCommandScopeToTlObject(scope, getInputPeer) {
|
|
7
7
|
switch (scope.type) {
|
|
8
8
|
case "default":
|
package/script/types/1_chat.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import { Color } from "./0_color.js";
|
|
3
2
|
import { ChatPhoto } from "./0_chat_photo.js";
|
|
3
|
+
import { Color } from "./0_color.js";
|
|
4
4
|
export type ChatType = "private" | "group" | "supergroup" | "channel";
|
|
5
5
|
export declare namespace Chat {
|
|
6
6
|
interface Base {
|
package/script/types/1_chat.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.constructChat = void 0;
|
|
|
4
4
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
5
5
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
6
6
|
const _4_constants_js_1 = require("../4_constants.js");
|
|
7
|
-
const _0_color_js_1 = require("./0_color.js");
|
|
8
7
|
const _0_chat_photo_js_1 = require("./0_chat_photo.js");
|
|
8
|
+
const _0_color_js_1 = require("./0_color.js");
|
|
9
9
|
function constructChat(chat) {
|
|
10
10
|
if (chat instanceof _2_tl_js_1.types.User) {
|
|
11
11
|
const id = Number(chat.id);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
|
-
import { Thumbnail } from "./0_thumbnail.js";
|
|
4
3
|
import { MaskPosition } from "./0_mask_position.js";
|
|
4
|
+
import { Thumbnail } from "./0_thumbnail.js";
|
|
5
5
|
/** This object represents a sticker. */
|
|
6
6
|
export interface Sticker {
|
|
7
7
|
/** Identifier for this file, which can be used to download or reuse the file */
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.constructSticker = void 0;
|
|
4
4
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
5
|
-
const _0_thumbnail_js_1 = require("./0_thumbnail.js");
|
|
6
5
|
const _0_mask_position_js_1 = require("./0_mask_position.js");
|
|
6
|
+
const _0_thumbnail_js_1 = require("./0_thumbnail.js");
|
|
7
7
|
async function constructSticker(document, fileId, fileUniqueId, getStickerSetName) {
|
|
8
8
|
const stickerAttribute = document.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeSticker);
|
|
9
9
|
const imageSizeAttribute = document.attributes.find((v) => v instanceof _2_tl_js_1.types.DocumentAttributeImageSize);
|
package/script/types/1_user.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import { Color } from "./0_color.js";
|
|
3
2
|
import { ChatPhoto } from "./0_chat_photo.js";
|
|
3
|
+
import { Color } from "./0_color.js";
|
|
4
4
|
/** This object represents a Telegram user or bot. */
|
|
5
5
|
export interface User {
|
|
6
6
|
/** Unique identifier for this user or bot */
|
package/script/types/1_user.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.constructUser = void 0;
|
|
4
4
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
5
5
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
6
|
-
const _0_color_js_1 = require("./0_color.js");
|
|
7
6
|
const _0_chat_photo_js_1 = require("./0_chat_photo.js");
|
|
7
|
+
const _0_color_js_1 = require("./0_color.js");
|
|
8
8
|
function constructUser(user_) {
|
|
9
9
|
const id = Number(user_.id);
|
|
10
10
|
const user = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import { WebAppInfo } from "./0_web_app_info.js";
|
|
3
2
|
import { LoginUrl } from "./0_login_url.js";
|
|
3
|
+
import { WebAppInfo } from "./0_web_app_info.js";
|
|
4
4
|
import { UsernameResolver } from "./1__getters.js";
|
|
5
5
|
export declare namespace InlineKeyboardButton {
|
|
6
6
|
interface Base {
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
|
-
import { ForceReply } from "./0_force_reply.js";
|
|
4
|
-
import { MessageEntity } from "./0_message_entity.js";
|
|
5
3
|
import { Audio } from "./0_audio.js";
|
|
6
4
|
import { Contact } from "./0_contact.js";
|
|
7
|
-
import { Voice } from "./0_voice.js";
|
|
8
|
-
import { Venue } from "./0_venue.js";
|
|
9
|
-
import { Location } from "./0_location.js";
|
|
10
5
|
import { Dice } from "./0_dice.js";
|
|
6
|
+
import { ForceReply } from "./0_force_reply.js";
|
|
7
|
+
import { Location } from "./0_location.js";
|
|
8
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
11
9
|
import { ReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
|
|
10
|
+
import { Venue } from "./0_venue.js";
|
|
11
|
+
import { Voice } from "./0_voice.js";
|
|
12
12
|
import { EntityGetter } from "./1__getters.js";
|
|
13
|
+
import { Animation } from "./1_animation.js";
|
|
13
14
|
import { Chat } from "./1_chat.js";
|
|
14
|
-
import { Photo } from "./1_photo.js";
|
|
15
15
|
import { Document } from "./1_document.js";
|
|
16
|
-
import {
|
|
17
|
-
import { VideoNote } from "./1_video_note.js";
|
|
18
|
-
import { Animation } from "./1_animation.js";
|
|
19
|
-
import { User } from "./1_user.js";
|
|
16
|
+
import { Photo } from "./1_photo.js";
|
|
20
17
|
import { Poll } from "./1_poll.js";
|
|
21
18
|
import { Sticker, StickerSetNameGetter } from "./1_sticker.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
19
|
+
import { User } from "./1_user.js";
|
|
20
|
+
import { VideoNote } from "./1_video_note.js";
|
|
21
|
+
import { Video } from "./1_video.js";
|
|
24
22
|
import { Game } from "./2_game.js";
|
|
23
|
+
import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
|
|
24
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
25
25
|
/** This object represents a message. */
|
|
26
26
|
export interface Message {
|
|
27
27
|
/** Whether the message is outgoing */
|
|
@@ -6,27 +6,27 @@ const _1_utilities_js_1 = require("../1_utilities.js");
|
|
|
6
6
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
7
7
|
const _4_constants_js_1 = require("../4_constants.js");
|
|
8
8
|
const _0__file_id_js_1 = require("./0__file_id.js");
|
|
9
|
-
const _0_force_reply_js_1 = require("./0_force_reply.js");
|
|
10
|
-
const _0_message_entity_js_1 = require("./0_message_entity.js");
|
|
11
9
|
const _0_audio_js_1 = require("./0_audio.js");
|
|
12
10
|
const _0_contact_js_1 = require("./0_contact.js");
|
|
13
|
-
const _0_voice_js_1 = require("./0_voice.js");
|
|
14
|
-
const _0_venue_js_1 = require("./0_venue.js");
|
|
15
|
-
const _0_location_js_1 = require("./0_location.js");
|
|
16
11
|
const _0_dice_js_1 = require("./0_dice.js");
|
|
12
|
+
const _0_force_reply_js_1 = require("./0_force_reply.js");
|
|
13
|
+
const _0_location_js_1 = require("./0_location.js");
|
|
14
|
+
const _0_message_entity_js_1 = require("./0_message_entity.js");
|
|
17
15
|
const _0_reply_keyboard_remove_js_1 = require("./0_reply_keyboard_remove.js");
|
|
16
|
+
const _0_venue_js_1 = require("./0_venue.js");
|
|
17
|
+
const _0_voice_js_1 = require("./0_voice.js");
|
|
18
|
+
const _1_animation_js_1 = require("./1_animation.js");
|
|
18
19
|
const _1_chat_js_1 = require("./1_chat.js");
|
|
19
|
-
const _1_photo_js_1 = require("./1_photo.js");
|
|
20
20
|
const _1_document_js_1 = require("./1_document.js");
|
|
21
|
-
const
|
|
22
|
-
const _1_video_note_js_1 = require("./1_video_note.js");
|
|
23
|
-
const _1_animation_js_1 = require("./1_animation.js");
|
|
24
|
-
const _1_user_js_1 = require("./1_user.js");
|
|
21
|
+
const _1_photo_js_1 = require("./1_photo.js");
|
|
25
22
|
const _1_poll_js_1 = require("./1_poll.js");
|
|
26
23
|
const _1_sticker_js_1 = require("./1_sticker.js");
|
|
27
|
-
const
|
|
28
|
-
const
|
|
24
|
+
const _1_user_js_1 = require("./1_user.js");
|
|
25
|
+
const _1_video_note_js_1 = require("./1_video_note.js");
|
|
26
|
+
const _1_video_js_1 = require("./1_video.js");
|
|
29
27
|
const _2_game_js_1 = require("./2_game.js");
|
|
28
|
+
const _2_reply_keyboard_markup_js_1 = require("./2_reply_keyboard_markup.js");
|
|
29
|
+
const _3_inline_keyboard_markup_js_1 = require("./3_inline_keyboard_markup.js");
|
|
30
30
|
const d = (0, _0_deps_js_1.debug)("types/Message");
|
|
31
31
|
async function getSender(message_, getEntity) {
|
|
32
32
|
if (message_.fromId instanceof _2_tl_js_1.types.PeerUser) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
2
|
import { MessageEntity } from "./0_message_entity.js";
|
|
3
3
|
import { ParseMode } from "./0_parse_mode.js";
|
|
4
|
+
import { UsernameResolver } from "./1__getters.js";
|
|
4
5
|
import { InlineQueryResultArticle } from "./4_inline_query_result_article.js";
|
|
5
6
|
import { InlineQueryResultAudio } from "./4_inline_query_result_audio.js";
|
|
6
7
|
import { InlineQueryResultCachedAudio } from "./4_inline_query_result_cached_audio.js";
|
|
@@ -21,7 +22,6 @@ import { InlineQueryResultPhoto } from "./4_inline_query_result_photo.js";
|
|
|
21
22
|
import { InlineQueryResultVenue } from "./4_inline_query_result_venue.js";
|
|
22
23
|
import { InlineQueryResultVideo } from "./4_inline_query_result_video.js";
|
|
23
24
|
import { InlineQueryResultVoice } from "./4_inline_query_result_voice.js";
|
|
24
|
-
import { UsernameResolver } from "./1__getters.js";
|
|
25
25
|
export type InlineQueryResult = InlineQueryResultCachedAudio | InlineQueryResultCachedDocument | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedPhoto | InlineQueryResultCachedSticker | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultArticle | InlineQueryResultAudio | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultDocument | InlineQueryResultGif | InlineQueryResultLocation | InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVenue | InlineQueryResultVideo | InlineQueryResultVoice;
|
|
26
26
|
export declare function inlineQueryResultToTlObject(result_: InlineQueryResult, parseText: (text: string, params?: {
|
|
27
27
|
parseMode?: ParseMode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.inlineQueryResultToTlObject = void 0;
|
|
4
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
4
5
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
5
6
|
const _0__file_id_js_1 = require("./0__file_id.js");
|
|
6
|
-
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
7
7
|
const _4_reply_markup_js_1 = require("./4_reply_markup.js");
|
|
8
8
|
// deno-lint-ignore no-explicit-any
|
|
9
9
|
async function inlineQueryResultToTlObject(result_, parseText, usernameResolver) {
|
|
@@ -24,16 +24,18 @@ class CTR {
|
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
encrypt(data) {
|
|
27
|
-
const
|
|
27
|
+
const v = new Uint8Array(data); // TODO: don't copy
|
|
28
|
+
const [iv, state] = (0, _0_deps_js_1.ctr256Encrypt)(v, this.key, this.iv, this.state);
|
|
28
29
|
this.iv = iv;
|
|
29
30
|
this.state = state;
|
|
30
|
-
return
|
|
31
|
+
return v;
|
|
31
32
|
}
|
|
32
33
|
decrypt(data) {
|
|
33
|
-
const
|
|
34
|
+
const v = new Uint8Array(data); // TODO: don't copy
|
|
35
|
+
const [iv, state] = (0, _0_deps_js_1.ctr256Decrypt)(v, this.key, this.iv, this.state);
|
|
34
36
|
this.iv = iv;
|
|
35
37
|
this.state = state;
|
|
36
|
-
return
|
|
38
|
+
return v;
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
exports.CTR = CTR;
|