diff --git a/languages/built-in/en.yml b/languages/built-in/en.yml index 28e4420..0201756 100644 --- a/languages/built-in/en.yml +++ b/languages/built-in/en.yml @@ -282,7 +282,7 @@ hitokoto_type_meme: trembling # plugin # apt apt_des: Used to manage plugins installed to PagerMaid-Modify. -apt_parameters: "{update|search|show|status|install|remove|enable|disable|upload} " +apt_parameters: "{update|search|show|status|install|remove|enable|disable|upload|export} " apt_processing: Installing plugins... apt_no_py: Something went wrong ~ Failed to get the plug-in file from the attachment. apt_plugin: plugin diff --git a/languages/built-in/zh-cn.yml b/languages/built-in/zh-cn.yml index e253f6a..2b5856a 100644 --- a/languages/built-in/zh-cn.yml +++ b/languages/built-in/zh-cn.yml @@ -295,7 +295,7 @@ hitokoto_type_meme: 抖机灵 # plugin ## apt apt_des: 用于管理安装到 PagerMaid-Modify 的插件。 -apt_parameters: "{update|search|show|status|install|remove|enable|disable|upload} <插件名称/文件>" +apt_parameters: "{update|search|show|status|install|remove|enable|disable|upload|export} <插件名称/文件>" apt_processing: 安装插件中 . . . apt_no_py: 出错了呜呜呜 ~ 无法从附件获取插件文件。 apt_plugin: 插件 diff --git a/languages/built-in/zh-tw.yml b/languages/built-in/zh-tw.yml index 0d65aea..1fcbb14 100644 --- a/languages/built-in/zh-tw.yml +++ b/languages/built-in/zh-tw.yml @@ -277,7 +277,7 @@ hitokoto_type_meme: 迷因 # plugin # apt apt_des: 用於管理插件。 -apt_parameters: "{update|search|show|status|install|remove|enable|disable|upload} <插件名稱/文件>" +apt_parameters: "{update|search|show|status|install|remove|enable|disable|upload|export} <插件名稱/文件>" apt_processing: 安裝插件中… apt_no_py: Error!無法獲取插件文件。 apt_plugin: 插件 diff --git a/pagermaid/modules/plugin.py b/pagermaid/modules/plugin.py index 442ba24..988061e 100644 --- a/pagermaid/modules/plugin.py +++ b/pagermaid/modules/plugin.py @@ -348,5 +348,26 @@ async def plugin(context): await context.edit(lang('apt_search_not_found')) else: await context.edit(search_result) + elif context.parameter[0] == "export": + if not exists(f"{plugin_directory}version.json"): + await context.edit(lang('apt_why_not_install_a_plugin')) + return + await context.edit(lang('stats_loading')) + list_plugin = [] + with open(f"{plugin_directory}version.json", 'r', encoding="utf-8") as f: + version_json = json.load(f) + temp, plugin_list = get_html(f"{git_source}list.json") + plugin_online = json.loads(plugin_list)['list'] + for key, value in version_json.items(): + if value == "0.0": + continue + for i in plugin_online: + if key == i['name']: + list_plugin.append(key) + break + if len(list_plugin) == 0: + await context.edit(lang('apt_why_not_install_a_plugin')) + else: + await context.edit('-apt install ' + ' '.join(list_plugin)) else: await context.edit(lang('arg_error'))