浏览代码

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

Coxxs 3 年之前
父节点
当前提交
865c28ea4b
共有 1 个文件被更改,包括 2 次插入2 次删除
  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
                                         ) {