MCPcopy
hub / github.com/lobehub/lobehub / findBot

Function findBot

apps/cli/src/commands/bot.ts:97–105  ·  view source on GitHub ↗

Find a bot by ID from the user's bot list.

(client: TrpcClient, botId: string)

Source from the content-addressed store, hash-verified

95
96/** Find a bot by ID from the user's bot list. */
97async function findBot(client: TrpcClient, botId: string) {
98 const bots = await client.agentBotProvider.list.query();
99 const bot = (bots as any[]).find((b: any) => b.id === botId);
100 if (!bot) {
101 log.error(`Bot integration not found: ${botId}`);
102 process.exit(1);
103 }
104 return bot;
105}
106
107const STATUS_COLORS: Record<string, (s: string) => string> = {
108 connected: pc.green,

Callers 3

registerAllowlistCommandFunction · 0.85
registerBotCommandFunction · 0.85

Calls 2

findMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected