pub struct Config {
pub token: String,
pub application_id: u64,
pub prefix: String,
pub status: Option<StatusConfig>,
pub data_dir: Utf8PathBuf,
pub test_guild: Option<GuildId>,
pub fml: FmlConfig,
pub deviantart: DeviantArtConfig,
pub sauce_nao: SauceNaoConfig,
pub open_ai: OpenAiConfig,
pub log: LogConfig,
pub extra: HashMap<String, Value>,
}Expand description
The bot config
Fields§
§token: StringThe discord token
application_id: u64The application id
prefix: StringPrefix for the bot
status: Option<StatusConfig>Status config
data_dir: Utf8PathBufData dir
test_guild: Option<GuildId>The test guild
fml: FmlConfigFML config
deviantart: DeviantArtConfigDeviantArt config
sauce_nao: SauceNaoConfigSauceNao config
open_ai: OpenAiConfigOpen AI config
log: LogConfigThe log config
extra: HashMap<String, Value>Unknown extra data
Implementations§
Source§impl Config
impl Config
Sourcepub fn status_name(&self) -> Option<&str>
pub fn status_name(&self) -> Option<&str>
Shortcut for getting the status name
Sourcepub fn status_url(&self) -> Option<&str>
pub fn status_url(&self) -> Option<&str>
Shortcut for getting the status url
Sourcepub fn status_type(&self) -> Option<ActivityKind>
pub fn status_type(&self) -> Option<ActivityKind>
Shortcut for getting the status type
Sourcepub fn log_file_dir(&self) -> Utf8PathBuf
pub fn log_file_dir(&self) -> Utf8PathBuf
The log file dir
Sourcepub fn load_from_path<P>(path: P) -> Result<Self>where
P: AsRef<Utf8Path>,
pub fn load_from_path<P>(path: P) -> Result<Self>where
P: AsRef<Utf8Path>,
Load a config from a path
Sourcepub fn load_from_str(s: &str) -> Result<Self>
pub fn load_from_str(s: &str) -> Result<Self>
Load a config from a str
Sourcepub fn validate(&mut self) -> Vec<ValidationMessage>
pub fn validate(&mut self) -> Vec<ValidationMessage>
Validate a config
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
Mutably borrows from an owned value. Read more
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request