From 7d0c182ce9d8e9ed090eca2f786bbaa34ba33154 Mon Sep 17 00:00:00 2001 From: acdenisSK Date: Thu, 27 Jul 2017 03:16:00 +0200 Subject: Make the `framework` module feature-gated and fix the names in the helper macro --- src/framework/mod.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src/framework') diff --git a/src/framework/mod.rs b/src/framework/mod.rs index d04f60f..d132b5b 100644 --- a/src/framework/mod.rs +++ b/src/framework/mod.rs @@ -84,20 +84,6 @@ use ::client::CACHE; #[cfg(feature="cache")] use ::model::Channel; -/// This trait allows for serenity to either use its builtin framework, or yours. -/// -/// When implementing, be sure to use `tokio_handle.spawn_fn(|| ...; Ok())` when dispatching commands. -/// -/// Note that you may see some other methods in here as well, but they're meant to be internal only for the builtin framework. -pub trait Framework { - fn dispatch(&mut self, Context, Message, &Handle); - - #[cfg(feature="builtin_framework")] - fn update_current_user(&mut self, UserId, bool) {} - #[cfg(feature="builtin_framework")] - fn initialized(&self) -> bool { false } -} - /// A macro to generate "named parameters". This is useful to avoid manually /// using the "arguments" parameter and manually parsing types. /// @@ -837,7 +823,7 @@ impl BuiltinFramework { } } -impl Framework for BuiltinFramework { +impl ::Framework for BuiltinFramework { fn dispatch(&mut self, mut context: Context, message: Message, tokio_handle: &Handle) { let res = command::positions(&mut context, &message, &self.configuration); -- cgit v1.2.3