WIP Telegram: modulo akode-telegram (API e impostazioni), in pausa
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -555,6 +555,9 @@ pub struct ConfigToml {
|
||||
/// Release source and startup check for `akode update`.
|
||||
pub update: Option<UpdateConfigToml>,
|
||||
|
||||
/// Telegram control of running sessions.
|
||||
pub telegram: Option<crate::types::TelegramConfigToml>,
|
||||
|
||||
/// Settings for app-specific controls.
|
||||
#[serde(default)]
|
||||
pub apps: Option<AppsConfigToml>,
|
||||
|
||||
@@ -251,6 +251,34 @@ pub struct UpdateConfigToml {
|
||||
pub check_on_startup: Option<bool>,
|
||||
}
|
||||
|
||||
/// `[telegram]`: control of running sessions from the user's Telegram bot.
|
||||
/// The bot token is never stored here: it lives in the key store under `telegram-bot`.
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Default, JsonSchema)]
|
||||
#[schemars(deny_unknown_fields)]
|
||||
pub struct TelegramConfigToml {
|
||||
/// When `true`, the shared app-server serves the bot. Defaults to `false`: nothing
|
||||
/// contacts Telegram while disabled.
|
||||
pub enabled: Option<bool>,
|
||||
/// Chats served by the bot (added by pairing in `/telegram`). Others are ignored.
|
||||
pub allowed_chat_ids: Option<Vec<i64>>,
|
||||
/// Which events are sent to Telegram. Every level defaults to `true`.
|
||||
pub notify: Option<TelegramNotifyToml>,
|
||||
}
|
||||
|
||||
/// `[telegram.notify]`: which events reach Telegram.
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Default, JsonSchema)]
|
||||
#[schemars(deny_unknown_fields)]
|
||||
pub struct TelegramNotifyToml {
|
||||
/// Approval requests with inline buttons.
|
||||
pub approvals: Option<bool>,
|
||||
/// A short summary when a turn ends.
|
||||
pub turn_end: Option<bool>,
|
||||
/// Errors and rate-limit (429) notices.
|
||||
pub errors: Option<bool>,
|
||||
/// Stops of the repeated-failure guard.
|
||||
pub loops: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default, JsonSchema)]
|
||||
#[schemars(deny_unknown_fields)]
|
||||
pub struct FeedbackConfigToml {
|
||||
|
||||
Reference in New Issue
Block a user