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

Method handleSetDefault

openlist/openlist.ts:487–501  ·  view source on GitHub ↗
(msg: Api.Message, path?: string)

Source from the content-addressed store, hash-verified

485 const passMatch = stdout.match(/password:\s*(\S+)/i);
486 if (userMatch) newUser = userMatch[1];
487 if (passMatch) newPass = passMatch[1];
488 }
489
490 // 更新本地凭证
491 if (newUser || newPass) {
492 await this.updateStoredCredentials(newUser, newPass);
493 await msg.edit({ text: `执行结果:\n\n${preTag((stdout || "").trim())}\n\n✅ 凭证已同步更新`, parseMode: "html" });
494 } else {
495 await msg.edit({ text: `执行结果:\n\n${preTag((stdout || "").trim())}`, parseMode: "html" });
496 }
497 } catch (error: any) {
498 await msg.edit({ text: `管理命令失败: ${htmlEscape(error?.message || error)}`, parseMode: "html" });
499 }
500 }
501
502 private async handleLogin(msg: Api.Message, user?: string, pass?: string) {
503 if (!user || !pass) {
504 await msg.edit({ text: `用法: ${commandName} login [用户名] [密码]` });

Callers 1

handleCommandMethod · 0.95

Calls 3

getDbMethod · 0.95
codeTagFunction · 0.70
editMethod · 0.45

Tested by

no test coverage detected