pub struct TelegramConfig {
pub enabled: bool,
pub bot_token: String,
pub stream_mode: StreamMode,
pub draft_update_interval_ms: u64,
pub interrupt_on_new_message: bool,
pub mention_only: bool,
pub ack_reactions: Option<bool>,
pub proxy_url: Option<String>,
pub approval_timeout_secs: u64,
pub excluded_tools: Vec<String>,
pub default_target: Option<String>,
}Expand description
Telegram bot channel configuration.
Fields§
§enabled: boolWhether this channel is active. The runtime only loads channels whose
enabled = true. Default: false so an operator who pastes a partial
[channels.<type>.<alias>] block doesn’t accidentally bring a channel
live before the rest of its config is filled in.
bot_token: StringTelegram Bot API token (from @BotFather).
stream_mode: StreamModeStreaming mode for progressive response delivery via message edits.
draft_update_interval_ms: u64Minimum interval (ms) between draft message edits to avoid rate limits.
interrupt_on_new_message: boolWhen true, a newer Telegram message from the same sender in the same chat cancels the in-flight request and starts a fresh response with preserved history.
mention_only: boolWhen true, only respond to messages that @-mention the bot in groups. Direct messages are always processed.
ack_reactions: Option<bool>Override for the top-level ack_reactions setting. When None, the
channel falls back to [channels].ack_reactions. When set
explicitly, it takes precedence.
proxy_url: Option<String>Per-channel proxy URL (http, https, socks5, socks5h).
Overrides the global [proxy] setting for this channel only.
approval_timeout_secs: u64How long (seconds) to wait for the operator to tap an inline-keyboard button on a tool approval prompt before auto-denying. Default: 120.
excluded_tools: Vec<String>Tools excluded from this channel’s tool spec. When set, these tools are not exposed to the model when responding via this channel.
default_target: Option<String>Default recipient for daemon/CLI channel_send calls.
Injected into the agent system prompt so it knows where to deliver
outbound messages without asking the user for a target ID.
Implementations§
Source§impl TelegramConfig
impl TelegramConfig
Sourcepub fn configurable_prefix() -> &'static str
pub fn configurable_prefix() -> &'static str
Returns the #[prefix] value for this Configurable struct.
Sourcepub fn secret_fields(&self) -> Vec<SecretFieldInfo>
pub fn secret_fields(&self) -> Vec<SecretFieldInfo>
Returns metadata about all #[secret] fields on this struct and nested children.
Sourcepub fn secret_field_terminals() -> Vec<&'static str>
pub fn secret_field_terminals() -> Vec<&'static str>
Static enumeration of every #[secret] field’s terminal name
(snake_case, matching the on-disk TOML key) reachable from
this type via #[nested] traversal. Unlike secret_fields(),
this requires no instance — the per-struct codegen literals
are joined at call time with recursive calls into the inner
types’ own secret_field_terminals().
Used by the migration crate’s raw-TOML encrypt walker as the
secret-key allowlist. prop_fields()-derived allowlists skip
compound (non-Vec) #[secret] fields, so this method is the
authoritative source.
Sourcepub fn encrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
pub fn encrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
Encrypt all secret fields in place using the provided store.
Sourcepub fn decrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
pub fn decrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
Decrypt all secret fields in place using the provided store.
Sourcepub fn set_secret(&mut self, name: &str, value: String) -> Result<(), Error>
pub fn set_secret(&mut self, name: &str, value: String) -> Result<(), Error>
Set a secret field by its full dotted name, dispatching to nested children.
Sourcepub fn prop_fields(&self) -> Vec<PropFieldInfo>
pub fn prop_fields(&self) -> Vec<PropFieldInfo>
Returns metadata about all property fields on this struct and nested children.
Sourcepub fn get_prop(&self, name: &str) -> Result<String, Error>
pub fn get_prop(&self, name: &str) -> Result<String, Error>
Get a property value by its full dotted name, returning it as a display string.
Sourcepub fn set_prop(&mut self, name: &str, value_str: &str) -> Result<(), Error>
pub fn set_prop(&mut self, name: &str, value_str: &str) -> Result<(), Error>
Set a property value by its full dotted name, parsing from string.
Sourcepub fn prop_is_secret(name: &str) -> bool
pub fn prop_is_secret(name: &str) -> bool
Check if a property name refers to a secret field (static, no instance needed).
Sourcepub fn init_defaults(&mut self, prefix: Option<&str>) -> Vec<&'static str>
pub fn init_defaults(&mut self, prefix: Option<&str>) -> Vec<&'static str>
Instantiate None nested sections whose prefix matches.
Returns the prefixes that were initialized.
Sourcepub fn map_key_sections() -> Vec<MapKeySection>
pub fn map_key_sections() -> Vec<MapKeySection>
Enumerate every map-keyed (HashMap<String, T>) and list-shaped
(Vec<T>) section discoverable from this Configurable’s tree.
The dashboard / CLI consume this to surface “+ Add” affordances
without hardcoding the section list.
Sourcepub fn nested_section_help(name: &str) -> Option<&'static str>
pub fn nested_section_help(name: &str) -> Option<&'static str>
Help blurb for a #[nested] field on this struct, sourced from
the field-level /// docstring. Returns None for unknown
names so callers can fall through to a different lookup.
Sourcepub fn get_map_keys(&self, section_path: &str) -> Option<Vec<String>>
pub fn get_map_keys(&self, section_path: &str) -> Option<Vec<String>>
Return the current alias keys at section_path, or None if
the path doesn’t resolve to a map-keyed section in this tree.
Sourcepub fn nested_option_entries(&self) -> Vec<NestedOptionEntry>
pub fn nested_option_entries(&self) -> Vec<NestedOptionEntry>
Snapshot of every #[nested] Option<T> field on this struct
as (field_name, is_some) tuples, in declaration order.
field_name is the raw Rust ident (snake_case) — consumers
can map to display names via their own table. The schema
is the single source of truth: adding a new
pub foo: Option<FooConfig> field with #[nested] surfaces
here without touching any caller.
Sourcepub fn create_map_key(
&mut self,
section_path: &str,
map_key: &str,
) -> Result<bool, String>
pub fn create_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>
Insert a default-valued entry under a map-keyed section, or
append to a list-shaped one, with map_key as the new entry’s
natural identifier (HashMap key for Map sections; identifier
field for List sections).
Returns Ok(true) if a new entry was created, Ok(false) if
the entry already existed (idempotent), or Err(reason) if
the section path doesn’t resolve to a Map/List in this tree.
Sourcepub fn delete_map_key(
&mut self,
section_path: &str,
map_key: &str,
) -> Result<bool, String>
pub fn delete_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>
Remove the entry identified by map_key from the map-keyed
section at section_path.
Returns Ok(true) if the entry existed and was removed,
Ok(false) if it didn’t exist, or Err(reason) if the
section path doesn’t resolve.
Sourcepub fn rename_map_key(
&mut self,
section_path: &str,
map_key: &str,
new_key: &str,
) -> Result<bool, String>
pub fn rename_map_key( &mut self, section_path: &str, map_key: &str, new_key: &str, ) -> Result<bool, String>
Rename map_key to new_key within the map-keyed section at
section_path, preserving the entry’s value.
Returns Ok(true) if renamed, Ok(false) if map_key didn’t
exist, or Err(reason) if new_key already exists or the
section path doesn’t resolve.
Trait Implementations§
Source§impl ChannelConfig for TelegramConfig
impl ChannelConfig for TelegramConfig
Source§impl Clone for TelegramConfig
impl Clone for TelegramConfig
Source§fn clone(&self) -> TelegramConfig
fn clone(&self) -> TelegramConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TelegramConfig
impl Debug for TelegramConfig
Source§impl Default for TelegramConfig
impl Default for TelegramConfig
Source§fn default() -> TelegramConfig
fn default() -> TelegramConfig
Source§impl<'de> Deserialize<'de> for TelegramConfig
impl<'de> Deserialize<'de> for TelegramConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TelegramConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TelegramConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for TelegramConfig
impl JsonSchema for TelegramConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl MaskSecrets for TelegramConfig
impl MaskSecrets for TelegramConfig
fn mask_secrets(&mut self)
fn restore_secrets_from(&mut self, current: &TelegramConfig)
Source§impl Serialize for TelegramConfig
impl Serialize for TelegramConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for TelegramConfig
impl RefUnwindSafe for TelegramConfig
impl Send for TelegramConfig
impl Sync for TelegramConfig
impl Unpin for TelegramConfig
impl UnsafeUnpin for TelegramConfig
impl UnwindSafe for TelegramConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more