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 /examples/06_voice/src | |
| 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 'examples/06_voice/src')
| -rw-r--r-- | examples/06_voice/src/main.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/06_voice/src/main.rs b/examples/06_voice/src/main.rs index 70878ac..d074eb8 100644 --- a/examples/06_voice/src/main.rs +++ b/examples/06_voice/src/main.rs @@ -10,10 +10,11 @@ #[macro_use] extern crate serenity; -use serenity::prelude::*; use serenity::client::CACHE; -use serenity::voice; +use serenity::framework::StandardFramework; use serenity::model::*; +use serenity::prelude::*; +use serenity::voice; use serenity::Result as SerenityResult; use std::env; @@ -31,7 +32,7 @@ fn main() { .expect("Expected a token in the environment"); let mut client = Client::new(&token, Handler); - client.with_framework(|f| f + client.with_framework(StandardFramework::new() .configure(|c| c .prefix("~") .on_mention(true)) @@ -43,7 +44,7 @@ fn main() { .on("ping", ping) .on("undeafen", undeafen) .on("unmute", unmute)); - + let _ = client.start().map_err(|why| println!("Client ended: {:?}", why)); } |