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,9 +44,13 @@ impl Module for EchoboxModule {
match split_command(&message.content) { match split_command(&message.content) {
Some((command, in_quote)) => { Some((command, in_quote)) => {
if command == self.prefix { if command == self.prefix {
match echobox.echo(in_quote) { if !in_quote.is_empty() {
Ok(out_quote) => message.reply(&format!("**Quote #{}:** {}", out_quote.id, out_quote.content)), match echobox.echo(in_quote) {
Err(error) => { error!("Error from echobox.echo(): {:?}", error) } 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.");
} }
} }
}, },