MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / OpenListPlugin

Class OpenListPlugin

openlist/openlist.ts:66–877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65• <code>${commandName} admin setuser [用户名]</code>
66• <code>${commandName} admin setpass [密码]</code>
67• <code>${commandName} admin random</code>
68• <code>${commandName} login [用户] [密码]</code> - 手动配置账号信息
69• <code>${commandName} setdefault [路径]</code> - 设置默认保存路径 (不填则恢复默认)
70
71• <code>${commandName} save [路径]</code> - (回复文件) 保存到 Openlist 目录 (指定路径则上传到挂载盘)
72
73<b>💡 示例:</b>
74• <code>${commandName} install /data/openlist</code>
75• <code>${commandName} setport 5255</code>
76`;
77
78class OpenListPlugin extends Plugin {
79
80 description: string = `\nOpenList 管理\n\n${helpText}`;
81 cmdHandlers: Record<string, (msg: Api.Message) => Promise<void>> = {
82 openlist: async (msg: Api.Message) => {
83 await this.handleCommand(msg);
84 },
85 op: async (msg: Api.Message) => {
86 await this.handleCommand(msg);
87 },
88 };
89
90 private async handleCommand(msg: Api.Message) {
91 const args = (msg.message || "").trim().split(/\s+/);
92 const sub = args[1] || "";
93
94 switch (sub) {
95 case "install":
96 if (!(await this.isSavedMessages(msg))) {
97 await msg.edit({ text: "⚠️ 此命令仅限在「收藏夹」中使用" });
98 return;
99 }
100 await msg.edit({ text: "正在准备安装..." });
101 await this.handleInstall(msg, args[2]);
102 break;
103 case "update":
104 if (!(await this.isSavedMessages(msg))) {
105 await msg.edit({ text: "⚠️ 此命令仅限在「收藏夹」中使用" });
106 return;
107 }
108 await msg.edit({ text: "正在准备更新..." });
109 await this.handleUpdate(msg);
110 break;
111 case "uninstall":
112 if (!(await this.isSavedMessages(msg))) {
113 await msg.edit({ text: "⚠️ 此命令仅限在「收藏夹」中使用" });
114 return;
115 }
116 await msg.edit({ text: "正在准备卸载..." });
117 await this.handleUninstall(msg);
118 break;
119 case "status":
120 if (!(await this.isSavedMessages(msg))) {
121 await msg.edit({ text: "⚠️ 此命令仅限在「收藏夹」中使用" });
122 return;
123 }

Callers

nothing calls this directly

Calls 1

handleCommandMethod · 0.95

Tested by

no test coverage detected