mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-24 09:15:33 +00:00
🔖 Update to v1.1.9
some small fix
This commit is contained in:
parent
b024004a94
commit
0dde5de2d1
@ -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()
|
||||
|
@ -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")
|
||||
|
@ -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'))
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user