From 0dde5de2d113f742e00ac80153b52820a2717055 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Tue, 5 Jul 2022 20:49:28 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Update=20to=20v1.1.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit some small fix --- pagermaid/__init__.py | 2 +- pagermaid/config.py | 2 +- pagermaid/modules/backup.py | 2 +- pagermaid/modules/help.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pagermaid/__init__.py b/pagermaid/__init__.py index 5dfdcc9..3e99a07 100644 --- a/pagermaid/__init__.py +++ b/pagermaid/__init__.py @@ -14,7 +14,7 @@ import pyromod.listen from pyrogram import Client import sys -pgm_version = "1.1.8" +pgm_version = "1.1.9" CMD_LIST = {} module_dir = __path__[0] working_dir = getcwd() diff --git a/pagermaid/config.py b/pagermaid/config.py index 168d258..9e93e87 100644 --- a/pagermaid/config.py +++ b/pagermaid/config.py @@ -22,7 +22,7 @@ def strtobool(val): try: - config = load(open(r"config.yml"), Loader=FullLoader) + config = load(open(r"config.yml", encoding="utf-8"), Loader=FullLoader) except FileNotFoundError: print("The configuration file does not exist, and a new configuration file is being generated.") copyfile(f"{os.getcwd()}{os.sep}config.gen.yml", "config.yml") diff --git a/pagermaid/modules/backup.py b/pagermaid/modules/backup.py index ee7061c..d0eeb60 100644 --- a/pagermaid/modules/backup.py +++ b/pagermaid/modules/backup.py @@ -40,7 +40,7 @@ def un_tar_gz(filename, dirs): @listener(is_plugin=False, outgoing=True, command="backup", - description=lang('back_des')) + description=lang('backup_des')) async def backup(message: Message): await message.edit(lang('backup_process')) diff --git a/pagermaid/modules/help.py b/pagermaid/modules/help.py index 4853ed4..8b901dc 100644 --- a/pagermaid/modules/help.py +++ b/pagermaid/modules/help.py @@ -105,7 +105,7 @@ async def lang_change(message: Message): file = pathlib.Path('config.yml').read_text() if to_lang in dir__: file = file.replace(f'application_language: "{from_lang}"', f'application_language: "{to_lang}"') - with open('config.yml', 'w') as f: + with open('config.yml', 'w', encoding="utf-8") as f: f.write(file) await message.edit(f"{lang('lang_change_to')} {to_lang}, {lang('lang_reboot')}") reload_all() @@ -143,7 +143,7 @@ async def alias_commands(message: Message): source_command = message.parameter[1] try: del Config.alias_dict[source_command] - with open(f"data{sep}alias.json", 'w') as f: + with open(f"data{sep}alias.json", 'w', encoding="utf-8") as f: json_dump(Config.alias_dict, f) await message.edit(lang('alias_success')) reload_all() @@ -157,7 +157,7 @@ async def alias_commands(message: Message): await message.edit(lang('alias_exist')) return Config.alias_dict[source_command] = to_command - with open(f"data{sep}alias.json", 'w') as f: + with open(f"data{sep}alias.json", 'w', encoding="utf-8") as f: json_dump(Config.alias_dict, f) await message.edit(lang('alias_success')) reload_all()