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

Method handleLogin

git_PR/git_PR.ts:192–204  ·  view source on GitHub ↗
(msg: Api.Message, args: string[])

Source from the content-addressed store, hash-verified

190 private async handleLogin(msg: Api.Message, args: string[]) {
191 if (args.length < 3) {
192 await msg.edit({ text: `❌ <b>参数不足</b>\n\n<b>格式:</b> <code>${mainPrefix}${pluginName} login &lt;邮箱&gt; &lt;用户名&gt; &lt;Token&gt;</code>`, parseMode: "html" });
193 return;
194 }
195
196 const [email, username, token] = args;
197 await ConfigManager.set(CONFIG_KEYS.EMAIL, email);
198 await ConfigManager.set(CONFIG_KEYS.USERNAME, username);
199 await ConfigManager.set(CONFIG_KEYS.TOKEN, token);
200
201 await msg.edit({ text: "✅ <b>登录信息已保存</b>", parseMode: "html" });
202 }
203
204 private async handleRepos(msg: Api.Message) {
205 await msg.edit({ text: "🔄 正在获取仓库列表...", parseMode: "html" });
206 const api = await getApi();
207 const response = await api.get(`/user/repos`, { params: { per_page: 100 } });

Callers 1

GitManagerPluginClass · 0.95

Calls 2

editMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected