Files
mimiclaw/main/telegram/telegram_bot.h
crispyberry da43c27003 feat: restore NVS runtime config with CLI commands (NVS > build-time priority)
Bring back two-layer configuration: build-time defaults from mimi_secrets.h
with runtime NVS overrides via serial CLI. NVS values take highest priority
so a pre-flashed board can be reconfigured anywhere with just a USB cable.

Restored CLI commands: wifi_set, set_tg_token, set_api_key, set_model,
set_proxy, clear_proxy, set_search_key. Added new commands: config_show
(displays all config with sensitive fields masked), config_reset (clears
all NVS overrides), and help (lists all commands).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 20:42:10 +08:00

28 lines
601 B
C

#pragma once
#include "esp_err.h"
/**
* Initialize the Telegram bot.
*/
esp_err_t telegram_bot_init(void);
/**
* Start the Telegram polling task (long polling on Core 0).
*/
esp_err_t telegram_bot_start(void);
/**
* Send a text message to a Telegram chat.
* Automatically splits messages longer than 4096 chars.
* @param chat_id Telegram chat ID (numeric string)
* @param text Message text (supports Markdown)
*/
esp_err_t telegram_send_message(const char *chat_id, const char *text);
/**
* Save the Telegram bot token to NVS.
*/
esp_err_t telegram_set_token(const char *token);