Skip to main content

telexide_fork/utils/
macros.rs

1/// This macro creates the [`Framework`] object using the given bot name and
2/// registers all the given commands on it. Call it as in
3/// `create_framework!("bot_name", command1, command2, ...)`
4///
5/// [`Framework`]: framework/struct.Framework.html
6#[macro_export]
7macro_rules! create_framework {
8    ($bot_name:expr, $( $c:expr ),*) => {
9        {
10            telexide_fork::paste_expr! {
11                let mut fr = telexide_fork::framework::Framework::new($bot_name);
12                $(
13                     fr.add_command(&(&[<$c _COMMAND>]));
14                )*
15                ::std::sync::Arc::new(fr)
16            }
17        }
18    }
19}