pub struct Bot { /* private fields */ }
Expand description
Main bot class
Implementations§
source§impl Bot
impl Bot
sourcepub fn builder(api_url: String, rest_url: String) -> Builder
pub fn builder(api_url: String, rest_url: String) -> Builder
Build a Bot
instance programmatically.
sourcepub async fn from_default_config() -> Result<Self, ConfigError>
pub async fn from_default_config() -> Result<Self, ConfigError>
Load Bot configuration from a default location, first look at
mwbot.toml
in the current directory, otherwise look in the
platform’s config directory:
- Linux:
$XDG_CONFIG_HOME
or$HOME/.config
- macOS:
$HOME/Library/Application Support
- Windows:
{FOLDERID_RoamingAppData}
sourcepub async fn from_path(path: &Path) -> Result<Self, ConfigError>
pub async fn from_path(path: &Path) -> Result<Self, ConfigError>
Load Bot configuration from the specified path.
sourcepub fn api(&self) -> &ApiClient
pub fn api(&self) -> &ApiClient
Get a reference to the underlying mwapi::Client
to make arbitrary API requests
sourcepub fn parsoid(&self) -> &ParsoidClient
pub fn parsoid(&self) -> &ParsoidClient
Get a reference to the underlying parsoid::Client
to make arbitrary Parsoid API requests