Macro command

Source
macro_rules! command {
    ($(#[$meta:meta])* ($command:expr => $command_name:ident())) => { ... };
    ($(#[$meta:meta])* ($command:expr => $command_name:ident($($name:ident),+))) => { ... };
}
Expand description

A macro for creating implementations of basic commands with up to four &str arguments.

§Examples

Simple command “TEST” with two &str arguments.

command! {
  /// Some command!
  ("TEST" => Test(user, message))
}
if let Some(Test(user, message)) = msg.command::<Test>() {
    println!("<{}> {}", user, message);
}