Forráskód Böngészése

Ignore min in in getInputPeer

painor 3 éve
szülő
commit
8c3fe90707
4 módosított fájl, 13 hozzáadás és 13 törlés
  1. 3 3
      gramjs/Utils.ts
  2. 1 1
      gramjs/Version.ts
  3. 8 8
      package-lock.json
  4. 1 1
      package.json

+ 3 - 3
gramjs/Utils.ts

@@ -89,13 +89,13 @@ export function getInputPeer(
     if (entity instanceof Api.User) {
         if (entity.self && allowSelf) {
             return new Api.InputPeerSelf();
-        } else if (entity.accessHash !== undefined || !checkHash) {
+        } else if ((entity.accessHash !== undefined && !entity.min) || !checkHash) {
             return new Api.InputPeerUser({
                 userId: entity.id,
                 accessHash: entity.accessHash || bigInt(0),
             });
         } else {
-            throw new Error("User without accessHash cannot be input");
+            throw new Error("User without accessHash or min cannot be input");
         }
     }
     if (
@@ -106,7 +106,7 @@ export function getInputPeer(
         return new Api.InputPeerChat({ chatId: entity.id });
     }
     if (entity instanceof Api.Channel) {
-        if (entity.accessHash !== undefined || !checkHash) {
+        if ((entity.accessHash !== undefined && !entity.min) || !checkHash) {
             return new Api.InputPeerChannel({
                 channelId: entity.id,
                 accessHash: entity.accessHash || bigInt(0),

+ 1 - 1
gramjs/Version.ts

@@ -1 +1 @@
-export const version = "1.8.4";
+export const version = "1.8.5";

+ 8 - 8
package-lock.json

@@ -1,12 +1,12 @@
 {
   "name": "telegram",
-  "version": "1.8.3",
+  "version": "1.8.5",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "telegram",
-      "version": "1.8.3",
+      "version": "1.8.5",
       "license": "MIT",
       "dependencies": {
         "@cryptography/aes": "^0.1.1",
@@ -9160,9 +9160,9 @@
       }
     },
     "node_modules/path-parse": {
-      "version": "1.0.6",
-      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
-      "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+      "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
       "dev": true
     },
     "node_modules/picomatch": {
@@ -19565,9 +19565,9 @@
       "dev": true
     },
     "path-parse": {
-      "version": "1.0.6",
-      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
-      "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+      "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
       "dev": true
     },
     "picomatch": {

+ 1 - 1
package.json

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