Merge branch 'pyrogram:master' into mtpager

This commit is contained in:
Sam 2022-01-12 00:28:27 +08:00 committed by GitHub
commit 86c81bfff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -408,7 +408,7 @@ def start(format: bool = False):
flag = FLAGS_RE_2.match(i[1]) flag = FLAGS_RE_2.match(i[1])
if flag: if flag:
if flag.group(2) == "true": if flag.group(2) == "true" or flag.group(2).startswith("Vector"):
write_flags.append(f"flags |= (1 << {flag.group(1)}) if self.{i[0]} else 0") write_flags.append(f"flags |= (1 << {flag.group(1)}) if self.{i[0]} else 0")
else: else:
write_flags.append(f"flags |= (1 << {flag.group(1)}) if self.{i[0]} is not None else 0") write_flags.append(f"flags |= (1 << {flag.group(1)}) if self.{i[0]} is not None else 0")
@ -441,7 +441,7 @@ def start(format: bool = False):
sub_type = arg_type.split("<")[1][:-1] sub_type = arg_type.split("<")[1][:-1]
write_types += "\n " write_types += "\n "
write_types += f"if self.{arg_name} is not None:\n " write_types += f"if self.{arg_name}:\n "
write_types += "b.write(Vector(self.{}{}))\n ".format( write_types += "b.write(Vector(self.{}{}))\n ".format(
arg_name, f", {sub_type.title()}" if sub_type in CORE_TYPES else "" arg_name, f", {sub_type.title()}" if sub_type in CORE_TYPES else ""
) )

View File

@ -16,7 +16,7 @@
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>. # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
__version__ = "1.3.4" __version__ = "1.3.5"
__license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)" __license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)"
__copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>" __copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>"