From a7b9d801a1cec8d3ca4e32093c73f4ebda906bd0 Mon Sep 17 00:00:00 2001 From: Adrian Malacoda Date: Sun, 26 Feb 2017 03:05:40 -0600 Subject: [PATCH] Require echobox to have a parameter --- src/modules/echobox.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/echobox.rs b/src/modules/echobox.rs index 55a0a41..c50b9ca 100644 --- a/src/modules/echobox.rs +++ b/src/modules/echobox.rs @@ -44,9 +44,13 @@ impl Module for EchoboxModule { match split_command(&message.content) { Some((command, in_quote)) => { if command == self.prefix { - match echobox.echo(in_quote) { - Ok(out_quote) => message.reply(&format!("**Quote #{}:** {}", out_quote.id, out_quote.content)), - Err(error) => { error!("Error from echobox.echo(): {:?}", error) } + if !in_quote.is_empty() { + match echobox.echo(in_quote) { + 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."); } } },