diff options
| author | Zeyla Hellyer <[email protected]> | 2017-08-19 09:36:15 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-08-19 09:39:44 -0700 |
| commit | 948b27ce74e8dce458d427d8159f2a821d4d7cec (patch) | |
| tree | bf82bedd1821ca210e4a9f08644581486738aed6 /src/client | |
| parent | Add html_root_url (diff) | |
| download | serenity-948b27ce74e8dce458d427d8159f2a821d4d7cec.tar.xz serenity-948b27ce74e8dce458d427d8159f2a821d4d7cec.zip | |
Move builtin framework impl to its own module
The framework is now moved in its entirity to the `framework` module,
with the `Framework` trait currently on its own and the builtin
implementation provided.
The builtin implementation has been renamed to "Standard".
Upgrade path:
Rename the `BuiltinFramework` import to `StandardFramework`. Instead of
importing builtin framework items from `serenity::framework`, import
them from `serenity::framework::standard`.
This is the beginning to #60. The root `framework` module (non-standard
implementation) will be built more by the time it's closed.
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/dispatch.rs | 4 | ||||
| -rw-r--r-- | src/client/mod.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/client/dispatch.rs b/src/client/dispatch.rs index a3d528e..0a2ad8d 100644 --- a/src/client/dispatch.rs +++ b/src/client/dispatch.rs @@ -46,12 +46,12 @@ fn context(conn: &Arc<Mutex<Shard>>, data: &Arc<Mutex<ShareMap>>) -> Context { Context::new(conn.clone(), data.clone()) } -#[cfg(feature = "builtin_framework")] +#[cfg(feature = "standard_framework")] macro_rules! helper { ($enabled:block else $disabled:block) => { $enabled } } -#[cfg(not(feature = "builtin_framework"))] +#[cfg(not(feature = "standard_framework"))] macro_rules! helper { ($enabled:block else $disabled:block) => { $disabled } } diff --git a/src/client/mod.rs b/src/client/mod.rs index 1a576f2..5821597 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -270,7 +270,7 @@ impl<H: EventHandler + 'static> Client<H> { /// # use serenity::prelude::EventHandler; /// # use std::error::Error; /// # - /// use serenity::framework::BuiltinFramework; + /// use serenity::framework::StandardFramework; /// /// struct Handler; /// @@ -280,7 +280,7 @@ impl<H: EventHandler + 'static> Client<H> { /// use std::env; /// /// let mut client = Client::new(&env::var("DISCORD_TOKEN")?, Handler); - /// client.with_framework(BuiltinFramework::new() + /// client.with_framework(StandardFramework::new() /// .configure(|c| c.prefix("~")) /// .command("ping", |c| c.exec_str("Pong!"))); /// # Ok(()) @@ -698,7 +698,7 @@ impl<H: EventHandler + 'static> Client<H> { // Update the framework's current user if the feature is enabled. // // This also acts as a form of check to ensure the token is correct. - #[cfg(all(feature = "builtin_framework", feature = "framework"))] + #[cfg(all(feature = "standard_framework", feature = "framework"))] { let user = http::get_current_user()?; |