Initial commit

This commit is contained in:
xtaodada 2022-02-02 21:03:59 +08:00
parent 5aae164e03
commit 8ee30d394c
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736

View File

@ -139,6 +139,7 @@ async def plugin(__: Client, context: Message):
if len(context.parameter) == 2:
if exists(f"{plugin_directory}{context.parameter[1]}.py"):
remove(f"{plugin_directory}{context.parameter[1]}.py")
if exists(f"{plugin_directory}version.json"):
with open(f"{plugin_directory}version.json", 'r', encoding="utf-8") as f:
version_json = json.load(f)
version_json[context.parameter[1]] = '0.0'
@ -150,6 +151,7 @@ async def plugin(__: Client, context: Message):
exit(1)
elif exists(f"{plugin_directory}{context.parameter[1]}.py.disabled"):
remove(f"{plugin_directory}{context.parameter[1]}.py.disabled")
if exists(f"{plugin_directory}version.json"):
with open(f"{plugin_directory}version.json", 'r', encoding="utf-8") as f:
version_json = json.load(f)
version_json[context.parameter[1]] = '0.0'