Add CommandExt trait
This commit is contained in:
parent
15dddb205f
commit
98916b0d2b
2 changed files with 43 additions and 14 deletions
|
|
@ -5,10 +5,8 @@ use euphoxide::api::Message;
|
|||
use euphoxide_bot::{
|
||||
bot::Bot,
|
||||
command::{
|
||||
bang::{General, Specific},
|
||||
basic::Described,
|
||||
botrulez::{FullHelp, Ping, ShortHelp},
|
||||
Command, Commands, Context, Info, Propagate,
|
||||
Command, CommandExt, Commands, Context, Info, Propagate,
|
||||
},
|
||||
};
|
||||
use tokio::sync::mpsc;
|
||||
|
|
@ -46,17 +44,20 @@ async fn run() -> anyhow::Result<()> {
|
|||
let (event_tx, mut event_rx) = mpsc::channel(10);
|
||||
|
||||
let commands = Commands::new()
|
||||
.then(Described::hidden(General::new("ping", Ping::default())))
|
||||
.then(Described::hidden(Specific::new("ping", Ping::default())))
|
||||
.then(Described::hidden(General::new(
|
||||
"help",
|
||||
ShortHelp::new("/me demonstrates how to use euphoxide"),
|
||||
)))
|
||||
.then(Described::hidden(Specific::new(
|
||||
"help",
|
||||
FullHelp::new().with_after("Created using euphoxide."),
|
||||
)))
|
||||
.then(General::new("pyramid", Pyramid));
|
||||
.then(Ping::default().general("ping").hidden())
|
||||
.then(Ping::default().specific("ping").hidden())
|
||||
.then(
|
||||
ShortHelp::new("/me demonstrates how to use euphoxide")
|
||||
.general("help")
|
||||
.hidden(),
|
||||
)
|
||||
.then(
|
||||
FullHelp::new()
|
||||
.with_after("Created using euphoxide.")
|
||||
.specific("help")
|
||||
.hidden(),
|
||||
)
|
||||
.then(Pyramid.general("pyramid"));
|
||||
|
||||
let bot: Bot = Bot::new_simple(commands, event_tx);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue