Просмотр исходного кода

use es2017 instead
try to fetch chat in events when not found.

painor 3 лет назад
Родитель
Сommit
fd71682fc3
6 измененных файлов с 12 добавлено и 10 удалено
  1. 1 1
      gramjs/Version.ts
  2. 5 3
      gramjs/tl/custom/chatGetter.ts
  3. 2 2
      package-lock.json
  4. 1 1
      package.json
  5. 2 3
      tsconfig.json
  6. 1 0
      webpack.config.js

+ 1 - 1
gramjs/Version.ts

@@ -1 +1 @@
-export const version = "1.8.13";
+export const version = "1.8.14";

+ 5 - 3
gramjs/tl/custom/chatGetter.ts

@@ -18,6 +18,7 @@ export class ChatGetter {
     _chat?: Entity;
     _broadcast?: boolean;
     public _client?: TelegramClient;
+
     [inspect.custom]() {
         return betterConsoleLog(this);
     }
@@ -72,11 +73,12 @@ export class ChatGetter {
     }
 
     async getInputChat() {
-        /*
         if (!this._inputChat && this.chatId && this._client) {
             try {
                 const target = this.chatId;
-                for await (const dialog of this._client.iterDialogs(100)) {
+                for await (const dialog of this._client.iterDialogs({
+                    limit: 100,
+                })) {
                     if (dialog.id === target) {
                         this._chat = dialog.entity;
                         this._inputChat = dialog.inputEntity;
@@ -87,7 +89,7 @@ export class ChatGetter {
                 // do nothing
             }
             return this._inputChat;
-        }*/
+        }
         return this._inputChat;
     }
 

+ 2 - 2
package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "telegram",
-  "version": "1.8.13",
+  "version": "1.8.14",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "telegram",
-      "version": "1.8.13",
+      "version": "1.8.14",
       "license": "MIT",
       "dependencies": {
         "@cryptography/aes": "^0.1.1",

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "telegram",
-  "version": "1.8.13",
+  "version": "1.8.14",
   "description": "NodeJS/Browser MTProto API Telegram client library,",
   "main": "index.js",
   "types": "index.d.ts",

+ 2 - 3
tsconfig.json

@@ -1,9 +1,8 @@
 {
   "compilerOptions": {
-    // We don't care about this since Parcel runs Babel after TypeScript
     "module": "commonjs",
-    "target": "es6",
-    "lib": ["dom", "es6", "es7"],
+    "target": "es2017",
+    "lib": ["dom", "es7"],
     "inlineSourceMap": true,
     "downlevelIteration": true,
     "allowJs": true,

+ 1 - 0
webpack.config.js

@@ -2,6 +2,7 @@ const path = require("path");
 const webpack = require("webpack");
 
 module.exports = {
+  target: ["web"],
   entry: path.resolve(__dirname, "gramjs/index.ts"),
   module: {
     rules: [