@mtkruto/node 0.62.0 → 0.62.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.
@@ -602,7 +602,7 @@ export class MessageManager {
602
602
  return message_;
603
603
  }
604
604
  async editInlineMessageReplyMarkup(inlineMessageId, params) {
605
- const id = deserializeInlineMessageId(inlineMessageId);
605
+ const id = await deserializeInlineMessageId(inlineMessageId);
606
606
  await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editInlineBotMessage", id, reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
607
607
  }
608
608
  async editMessageText(chatId, messageId, text, params) {
@@ -696,7 +696,7 @@ export class MessageManager {
696
696
  async editInlineMessageMedia(inlineMessageId, media, params) {
697
697
  __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_checkParams).call(this, params);
698
698
  __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertBot("editInlineMessageMedia");
699
- const id = deserializeInlineMessageId(inlineMessageId);
699
+ const id = await deserializeInlineMessageId(inlineMessageId);
700
700
  await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editInlineBotMessage", id, media: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveInputMedia).call(this, media), reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
701
701
  }
702
702
  async deleteMessages(chatId, messageIds, params) {
@@ -987,7 +987,7 @@ export class MessageManager {
987
987
  async editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params) {
988
988
  __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_checkParams).call(this, params);
989
989
  __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertBot("editInlineMessageLiveLocation");
990
- const id = deserializeInlineMessageId(inlineMessageId);
990
+ const id = await deserializeInlineMessageId(inlineMessageId);
991
991
  await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editInlineBotMessage", id, media: ({ _: "inputMediaGeoLive", geo_point: ({ _: "inputGeoPoint", lat: latitude, long: longitude, accuracy_radius: params?.horizontalAccuracy }), heading: params?.heading, proximity_notification_radius: params?.proximityAlertRadius }), reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
992
992
  }
993
993
  async sendInvoice(chatId, title, description, payload, currency, prices, params) {
@@ -1348,7 +1348,7 @@ _a = MessageManager, _MessageManager_c = new WeakMap(), _MessageManager_Lresolve
1348
1348
  if (!allowEmpty && !message) {
1349
1349
  throw new InputError("Message text cannot be empty.");
1350
1350
  }
1351
- const id = deserializeInlineMessageId(inlineMessageId);
1351
+ const id = await deserializeInlineMessageId(inlineMessageId);
1352
1352
  const noWebpage = params?.linkPreview?.disable ? true : undefined;
1353
1353
  const invertMedia = params?.linkPreview?.aboveText ? true : undefined;
1354
1354
  let media = undefined;
@@ -38,6 +38,6 @@ export interface CallbackQuery {
38
38
  /** The short name of the game to be returned. */
39
39
  gameShortName?: string;
40
40
  }
41
- export declare function deserializeInlineMessageId(inlineMessageId: string): Api.InputBotInlineMessageID;
41
+ export declare function deserializeInlineMessageId(inlineMessageId: string): Promise<Api.InputBotInlineMessageID>;
42
42
  export declare function constructCallbackQuery(callbackQuery: Api.updateBotCallbackQuery | Api.updateInlineBotCallbackQuery, getEntity: EntityGetter, getMessage: MessageGetter): Promise<CallbackQuery>;
43
43
  //# sourceMappingURL=5_callback_query.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"5_callback_query.d.ts","sourceRoot":"","sources":["../../src/types/5_callback_query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAwC,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,C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e,CAAC,EAAE,MAAM,CAAC;IACzB,gHAAgH;IAChH,YAAY,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,wBAAsB,0BAA0B,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAa9G;AAED,wBAAsB,sBAAsB,CAAC,aAAa,EAAE,GAAG,CAAC,sBAAsB,GAAG,GAAG,CAAC,4BAA4B,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAmBrM"}
@@ -23,11 +23,11 @@ import { base64DecodeUrlSafe, base64EncodeUrlSafe, cleanObject } from "../1_util
23
23
  import { is, peerToChatId, TLReader, TLWriter } from "../2_tl.js";
24
24
  import { constructUser } from "./1_user.js";
25
25
  const ERR_INVALID_INLINE_MESSAGE_ID = new InputError("Invalid inline message ID");
26
- export function deserializeInlineMessageId(inlineMessageId) {
26
+ export async function deserializeInlineMessageId(inlineMessageId) {
27
27
  try {
28
28
  const buffer = base64DecodeUrlSafe(inlineMessageId);
29
29
  const reader = new TLReader(buffer);
30
- const object = reader.deserialize("InputBotInlineMessageID");
30
+ const object = await reader.deserialize("InputBotInlineMessageID");
31
31
  if (is("inputBotInlineMessageID64", object) || is("inputBotInlineMessageID", object)) {
32
32
  return object;
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtkruto/node",
3
- "version": "0.62.0",
3
+ "version": "0.62.1",
4
4
  "description": "MTKruto for Node.js",
5
5
  "author": "Roj <rojvv@icloud.com>",
6
6
  "repository": {
@@ -605,7 +605,7 @@ class MessageManager {
605
605
  return message_;
606
606
  }
607
607
  async editInlineMessageReplyMarkup(inlineMessageId, params) {
608
- const id = (0, _3_types_js_2.deserializeInlineMessageId)(inlineMessageId);
608
+ const id = await (0, _3_types_js_2.deserializeInlineMessageId)(inlineMessageId);
609
609
  await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editInlineBotMessage", id, reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
610
610
  }
611
611
  async editMessageText(chatId, messageId, text, params) {
@@ -699,7 +699,7 @@ class MessageManager {
699
699
  async editInlineMessageMedia(inlineMessageId, media, params) {
700
700
  __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_checkParams).call(this, params);
701
701
  __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertBot("editInlineMessageMedia");
702
- const id = (0, _3_types_js_2.deserializeInlineMessageId)(inlineMessageId);
702
+ const id = await (0, _3_types_js_2.deserializeInlineMessageId)(inlineMessageId);
703
703
  await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editInlineBotMessage", id, media: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_resolveInputMedia).call(this, media), reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
704
704
  }
705
705
  async deleteMessages(chatId, messageIds, params) {
@@ -990,7 +990,7 @@ class MessageManager {
990
990
  async editInlineMessageLiveLocation(inlineMessageId, latitude, longitude, params) {
991
991
  __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_checkParams).call(this, params);
992
992
  __classPrivateFieldGet(this, _MessageManager_c, "f").storage.assertBot("editInlineMessageLiveLocation");
993
- const id = (0, _3_types_js_2.deserializeInlineMessageId)(inlineMessageId);
993
+ const id = await (0, _3_types_js_2.deserializeInlineMessageId)(inlineMessageId);
994
994
  await __classPrivateFieldGet(this, _MessageManager_c, "f").invoke({ _: "messages.editInlineBotMessage", id, media: ({ _: "inputMediaGeoLive", geo_point: ({ _: "inputGeoPoint", lat: latitude, long: longitude, accuracy_radius: params?.horizontalAccuracy }), heading: params?.heading, proximity_notification_radius: params?.proximityAlertRadius }), reply_markup: await __classPrivateFieldGet(this, _MessageManager_instances, "m", _MessageManager_constructReplyMarkup).call(this, params) });
995
995
  }
996
996
  async sendInvoice(chatId, title, description, payload, currency, prices, params) {
@@ -1352,7 +1352,7 @@ _a = MessageManager, _MessageManager_c = new WeakMap(), _MessageManager_Lresolve
1352
1352
  if (!allowEmpty && !message) {
1353
1353
  throw new _0_errors_js_1.InputError("Message text cannot be empty.");
1354
1354
  }
1355
- const id = (0, _3_types_js_2.deserializeInlineMessageId)(inlineMessageId);
1355
+ const id = await (0, _3_types_js_2.deserializeInlineMessageId)(inlineMessageId);
1356
1356
  const noWebpage = params?.linkPreview?.disable ? true : undefined;
1357
1357
  const invertMedia = params?.linkPreview?.aboveText ? true : undefined;
1358
1358
  let media = undefined;
@@ -38,6 +38,6 @@ export interface CallbackQuery {
38
38
  /** The short name of the game to be returned. */
39
39
  gameShortName?: string;
40
40
  }
41
- export declare function deserializeInlineMessageId(inlineMessageId: string): Api.InputBotInlineMessageID;
41
+ export declare function deserializeInlineMessageId(inlineMessageId: string): Promise<Api.InputBotInlineMessageID>;
42
42
  export declare function constructCallbackQuery(callbackQuery: Api.updateBotCallbackQuery | Api.updateInlineBotCallbackQuery, getEntity: EntityGetter, getMessage: MessageGetter): Promise<CallbackQuery>;
43
43
  //# sourceMappingURL=5_callback_query.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"5_callback_query.d.ts","sourceRoot":"","sources":["../../src/types/5_callback_query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAwC,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAExD,iCAAiC;AACjC,MAAM,WAAW,aAAa;IAC5B,4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,CAAC;IACd,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,wBAAsB,0BAA0B,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAa9G;AAED,wBAAsB,sBAAsB,CAAC,aAAa,EAAE,GAAG,CAAC,sBAAsB,GAAG,GAAG,CAAC,4BAA4B,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAmBrM"}
@@ -27,11 +27,11 @@ const _1_utilities_js_1 = require("../1_utilities.js");
27
27
  const _2_tl_js_1 = require("../2_tl.js");
28
28
  const _1_user_js_1 = require("./1_user.js");
29
29
  const ERR_INVALID_INLINE_MESSAGE_ID = new _0_errors_js_1.InputError("Invalid inline message ID");
30
- function deserializeInlineMessageId(inlineMessageId) {
30
+ async function deserializeInlineMessageId(inlineMessageId) {
31
31
  try {
32
32
  const buffer = (0, _1_utilities_js_1.base64DecodeUrlSafe)(inlineMessageId);
33
33
  const reader = new _2_tl_js_1.TLReader(buffer);
34
- const object = reader.deserialize("InputBotInlineMessageID");
34
+ const object = await reader.deserialize("InputBotInlineMessageID");
35
35
  if ((0, _2_tl_js_1.is)("inputBotInlineMessageID64", object) || (0, _2_tl_js_1.is)("inputBotInlineMessageID", object)) {
36
36
  return object;
37
37
  }