pub struct NotifyConfig {
pub on: Vec<String>,
pub discord_webhook: Option<String>,
pub telegram_bot_token: Option<String>,
pub telegram_chat_id: Option<String>,
pub timeout_secs: u64,
pub desktop: Option<bool>,
}Expand description
Session notifications over Discord Incoming Webhooks, Telegram bots, and/or the terminal (desktop notification via OSC 9 / OSC 777).
Off until on is non-empty and at least one channel is configured.
Secrets should live in env (WHYCODES_NOTIFY_*) or ${VAR} substitution,
not in a committed project config.
[notify]
on = ["turn_done", "need_input"]
discord_webhook = "${DISCORD_WEBHOOK_URL}"
telegram_bot_token = "${TELEGRAM_BOT_TOKEN}"
telegram_chat_id = "${TELEGRAM_CHAT_ID}"
desktop = true # TUI only, while the terminal window is not focusedFields§
§on: Vec<String>Events that fire a message. Empty = disabled.
Known values: turn_done, need_input.
discord_webhook: Option<String>Discord Incoming Webhook URL. Empty / omitted = skip Discord.
telegram_bot_token: Option<String>Telegram bot token from BotFather. Empty / omitted = skip Telegram.
telegram_chat_id: Option<String>Telegram chat / group / channel id (sendMessage chat_id).
timeout_secs: u64HTTP timeout per channel. Default 8s, clamped 1–60.
desktop: Option<bool>Desktop notification from the TUI through the terminal (OSC 9 / 777), sent only while the terminal window is not focused. Omitted = off.
Implementations§
Source§impl NotifyConfig
impl NotifyConfig
Sourcepub fn wants(&self, event: NotifyEvent) -> bool
pub fn wants(&self, event: NotifyEvent) -> bool
True when this event is listed in on (case-insensitive).
Sourcepub fn discord_webhook_url(&self) -> Option<&str>
pub fn discord_webhook_url(&self) -> Option<&str>
Discord webhook after trim; None if unset/blank.
Sourcepub fn telegram_token(&self) -> Option<&str>
pub fn telegram_token(&self) -> Option<&str>
Telegram bot token after trim; None if unset/blank.
Sourcepub fn telegram_chat(&self) -> Option<&str>
pub fn telegram_chat(&self) -> Option<&str>
Telegram chat id after trim; None if unset/blank.
Sourcepub fn has_channel(&self) -> bool
pub fn has_channel(&self) -> bool
True when Discord and/or a complete Telegram pair is configured.
Sourcepub fn enabled_for(&self, event: NotifyEvent) -> bool
pub fn enabled_for(&self, event: NotifyEvent) -> bool
True when this event should actually be sent.
Sourcepub fn desktop_for(&self, event: NotifyEvent) -> bool
pub fn desktop_for(&self, event: NotifyEvent) -> bool
True when the TUI should raise a desktop notification for this event.
Trait Implementations§
Source§impl Clone for NotifyConfig
impl Clone for NotifyConfig
Source§impl Debug for NotifyConfig
impl Debug for NotifyConfig
Source§impl Default for NotifyConfig
impl Default for NotifyConfig
Source§impl<'de> Deserialize<'de> for NotifyConfig
impl<'de> Deserialize<'de> for NotifyConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for NotifyConfig
Source§impl PartialEq for NotifyConfig
impl PartialEq for NotifyConfig
Source§impl Serialize for NotifyConfig
impl Serialize for NotifyConfig
impl StructuralPartialEq for NotifyConfig
Auto Trait Implementations§
impl Freeze for NotifyConfig
impl RefUnwindSafe for NotifyConfig
impl Send for NotifyConfig
impl Sync for NotifyConfig
impl Unpin for NotifyConfig
impl UnsafeUnpin for NotifyConfig
impl UnwindSafe for NotifyConfig
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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