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

Method handleRepos

git_PR/git_PR.ts:206–221  ·  view source on GitHub ↗
(msg: Api.Message)

Source from the content-addressed store, hash-verified

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 } });
208
209 const repos = (response.data as any[])
210 .filter((r: any) => r?.permissions?.push || r?.permissions?.admin || r?.permissions?.maintain)
211 .map((r: any) => r.full_name);
212 if (!repos.length) {
213 await msg.edit({ text: "ℹ️ 未找到有编辑权限的仓库。", parseMode: "html" });
214 return;
215 }
216
217 const repoList = repos.map((repo: string) => `• <code>${htmlEscape(repo)}</code>`).join("\n");
218 await sendLongMessage(msg, `🗂️ <b>有编辑权限的仓库:</b>\n\n${repoList}`);
219 }
220
221 private async handlePRs(msg: Api.Message, args: string[]) {
222 if (args.length < 1) {
223 throw new Error("参数不足,需要提供仓库名");
224 }

Callers 1

GitManagerPluginClass · 0.95

Calls 5

getApiFunction · 0.85
htmlEscapeFunction · 0.70
sendLongMessageFunction · 0.70
editMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected