Explorar el Código

Fix `flags.n?Bool` is incorrectly ignored (#364)

Coxxs hace 3 años
padre
commit
865c28ea4b
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      gramjs/tl/api.js

+ 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
                                         ) {