Require echobox to have a parameter

This commit is contained in:
Adrian Malacoda 2017-02-26 03:05:40 -06:00
parent fd1aecf4d3
commit a7b9d801a1

View File

@ -44,10 +44,14 @@ impl Module for EchoboxModule {
match split_command(&message.content) {
Some((command, in_quote)) => {
if command == self.prefix {
if !in_quote.is_empty() {
match echobox.echo(in_quote) {
Ok(out_quote) => message.reply(&format!("**Quote #{}:** {}", out_quote.id, out_quote.content)),
Ok(out_quote) => message.reply(&format!("**Echobox, quote #{}:** {}", out_quote.id, out_quote.content)),
Err(error) => { error!("Error from echobox.echo(): {:?}", error) }
}
} else {
message.reply("**Echobox:** Please enter a quote.");
}
}
},
_ => {}