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: String
The discord token
application_id: u64
The application id
prefix: String
Prefix for the bot
status: Option<StatusConfig>
Status config
data_dir: Utf8PathBuf
Data dir
test_guild: Option<GuildId>
The test guild
fml: FmlConfig
FML config
deviantart: DeviantArtConfig
DeviantArt config
sauce_nao: SauceNaoConfig
SauceNao config
open_ai: OpenAiConfig
Open AI config
log: LogConfig
The 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 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