Parcourir la source

Merge branch 'master' of https://github.com/gram-js/gramjs

Painor il y a 3 ans
Parent
commit
0dc3774c46
2 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 2 0
      gramjs/client/downloads.ts
  2. 2 2
      gramjs/tl/api.js

+ 2 - 0
gramjs/client/downloads.ts

@@ -85,6 +85,7 @@ export interface DownloadFileParamsV2 {
 export interface DownloadProfilePhotoParams {
     /** Whether to download the big version or the small one of the photo */
     isBig?: boolean;
+    outputFile?: OutFile;
 }
 
 interface Deferred {
@@ -854,6 +855,7 @@ export async function downloadProfilePhoto(
         return Buffer.alloc(0);
     }
     return client.downloadFile(loc, {
+        outputFile: fileParams.outputFile,
         dcId,
     });
 }

+ 2 - 2
gramjs/tl/api.js

@@ -424,7 +424,7 @@ function createClasses(classesType, params) {
                     if (argsConfig.hasOwnProperty(arg)) {
                         if (argsConfig[arg].isFlag) {
                             if (
-                                this[arg] === false ||
+                                (this[arg] === false && argsConfig[arg].type !== 'Bool') ||
                                 this[arg] === null ||
                                 this[arg] === undefined ||
                                 argsConfig[arg].type === "true"
@@ -460,7 +460,7 @@ function createClasses(classesType, params) {
                                 for (const f in argsConfig) {
                                     if (argsConfig[f].isFlag) {
                                         if (
-                                            this[f] === false ||
+                                            (this[f] === false && argsConfig[f].type !== 'Bool') ||
                                             this[f] === undefined ||
                                             this[f] === null
                                         ) {