Prechádzať zdrojové kódy

Bring back network call

painor 3 rokov pred
rodič
commit
8fa886e2a0
4 zmenil súbory, kde vykonal 11 pridanie a 4 odobranie
  1. 1 1
      gramjs/Version.ts
  2. 7 0
      gramjs/client/users.ts
  3. 2 2
      package-lock.json
  4. 1 1
      package.json

+ 1 - 1
gramjs/Version.ts

@@ -1 +1 @@
-export const version = "2.0.2";
+export const version = "2.0.3";

+ 7 - 0
gramjs/client/users.ts

@@ -275,6 +275,13 @@ export async function getInputEntity(
         }
         // eslint-disable-next-line no-empty
     } catch (e) {}
+    // Only network left to try
+    try {
+        if (typeof peer === "string") {
+            return utils.getInputPeer(await _getEntityFromString(client, peer));
+        }
+    }catch (e) {}
+
     // If we're a bot and the user has messaged us privately users.getUsers
     // will work with accessHash = 0. Similar for channels.getChannels.
     // If we're not a bot but the user is in our contacts, it seems to work

+ 2 - 2
package-lock.json

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

+ 1 - 1
package.json

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