pub struct DiscordConfig {
pub token: Option<String>,
pub application_id: Option<String>,
pub allowed_user_ids: Vec<String>,
pub allowed_role_ids: Vec<String>,
pub allowed_channel_ids: Vec<String>,
pub skills: ChannelSkillsConfig,
pub allowed_tools: Option<Vec<String>>,
}Fields§
§token: Option<String>Bot token. Set to None and resolve from vault via ZEPH_DISCORD_TOKEN.
§Security
Never serialized: --init always persists this field as None (the real token
goes to the vault), but runtime config resolution hydrates the real value into this
field in memory. #[serde(skip_serializing)] keeps any future diagnostic Serialize
of a live Config from leaking it; Deserialize is untouched so inline tokens in a
hand-edited config.toml still load.
application_id: Option<String>Public Discord application snowflake — not a secret, safe to serialize.
allowed_user_ids: Vec<String>Discord user snowflakes allowed to interact with the bot.
At least one of allowed_user_ids or allowed_role_ids must be
non-empty: the channel refuses to start (fail-closed) rather than run
open to any sender when both are unconfigured.
allowed_role_ids: Vec<String>Discord role snowflakes allowed to interact with the bot.
See allowed_user_ids for the fail-closed
startup requirement shared with this field.
allowed_channel_ids: Vec<String>Discord channel snowflakes the bot responds in (empty = all channels).
skills: ChannelSkillsConfig§allowed_tools: Option<Vec<String>>Tool allowlist for this channel. None means all tools are permitted.
Trait Implementations§
Source§impl Clone for DiscordConfig
impl Clone for DiscordConfig
Source§fn clone(&self) -> DiscordConfig
fn clone(&self) -> DiscordConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiscordConfig
impl Debug for DiscordConfig
Source§impl<'de> Deserialize<'de> for DiscordConfig
impl<'de> Deserialize<'de> for DiscordConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DiscordConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DiscordConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for DiscordConfig
impl Serialize for DiscordConfig
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 DiscordConfig
impl RefUnwindSafe for DiscordConfig
impl Send for DiscordConfig
impl Sync for DiscordConfig
impl Unpin for DiscordConfig
impl UnsafeUnpin for DiscordConfig
impl UnwindSafe for DiscordConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request