feat: wire feishu into app and cli
Signed-off-by: Asklv <boironic@gmail.com>
This commit is contained in:
12
main/mimi.c
12
main/mimi.c
@@ -12,7 +12,8 @@
|
||||
#include "mimi_config.h"
|
||||
#include "bus/message_bus.h"
|
||||
#include "wifi/wifi_manager.h"
|
||||
#include "telegram/telegram_bot.h"
|
||||
#include "channels/telegram/telegram_bot.h"
|
||||
#include "channels/feishu/feishu_bot.h"
|
||||
#include "llm/llm_proxy.h"
|
||||
#include "agent/agent_loop.h"
|
||||
#include "memory/memory_store.h"
|
||||
@@ -78,6 +79,13 @@ static void outbound_dispatch_task(void *arg)
|
||||
} else {
|
||||
ESP_LOGI(TAG, "Telegram send success for %s (%d bytes)", msg.chat_id, (int)strlen(msg.content));
|
||||
}
|
||||
} else if (strcmp(msg.channel, MIMI_CHAN_FEISHU) == 0) {
|
||||
esp_err_t send_err = feishu_send_message(msg.chat_id, msg.content);
|
||||
if (send_err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Feishu send failed for %s: %s", msg.chat_id, esp_err_to_name(send_err));
|
||||
} else {
|
||||
ESP_LOGI(TAG, "Feishu send success for %s (%d bytes)", msg.chat_id, (int)strlen(msg.content));
|
||||
}
|
||||
} else if (strcmp(msg.channel, MIMI_CHAN_WEBSOCKET) == 0) {
|
||||
esp_err_t ws_err = ws_server_send(msg.chat_id, msg.content);
|
||||
if (ws_err != ESP_OK) {
|
||||
@@ -121,6 +129,7 @@ void app_main(void)
|
||||
ESP_ERROR_CHECK(wifi_manager_init());
|
||||
ESP_ERROR_CHECK(http_proxy_init());
|
||||
ESP_ERROR_CHECK(telegram_bot_init());
|
||||
ESP_ERROR_CHECK(feishu_bot_init());
|
||||
ESP_ERROR_CHECK(llm_proxy_init());
|
||||
ESP_ERROR_CHECK(tool_registry_init());
|
||||
ESP_ERROR_CHECK(cron_service_init());
|
||||
@@ -149,6 +158,7 @@ void app_main(void)
|
||||
/* Start network-dependent services */
|
||||
ESP_ERROR_CHECK(agent_loop_start());
|
||||
ESP_ERROR_CHECK(telegram_bot_start());
|
||||
ESP_ERROR_CHECK(feishu_bot_start());
|
||||
cron_service_start();
|
||||
heartbeat_start();
|
||||
ESP_ERROR_CHECK(ws_server_start());
|
||||
|
||||
Reference in New Issue
Block a user