MCPcopy Create free account
hub / github.com/Hanson/claude-client / initialize

Method initialize

src/feishu/handler.ts:94–108  ·  view source on GitHub ↗

* 初始化 - 获取机器人信息

()

Source from the content-addressed store, hash-verified

92 * 初始化 - 获取机器人信息
93 */
94 async initialize(): Promise<void> {
95 try {
96 const botInfo = await this.client.getBotInfo();
97 this.botOpenId = botInfo.botOpenId;
98 this.client.setBotOpenId(botInfo.botOpenId);
99 logger.info(`Bot initialized: ${botInfo.botName} (${botInfo.botOpenId})`);
100 } catch (error) {
101 const errorMsg = error instanceof Error ? error.message : String(error);
102 logger.error(`Failed to initialize Feishu bot: ${errorMsg}`);
103 throw new Error(
104 `飞书机器人初始化失败。请检查 .env 文件中的 FEISHU_APP_ID 和 FEISHU_APP_SECRET 是否正确。\n` +
105 `错误详情: ${errorMsg}`
106 );
107 }
108 }
109
110 /**
111 * 设置事件处理器

Callers 1

startMethod · 0.80

Calls 2

getBotInfoMethod · 0.80
setBotOpenIdMethod · 0.80

Tested by

no test coverage detected