From b7548e5e743bf1027ff55a2f86b3f6730e4b3e4f Mon Sep 17 00:00:00 2001
From: tec <tec@ucc.gu.uwa.edu.au>
Date: Mon, 5 Aug 2019 15:37:02 +0800
Subject: [PATCH] No empty motions

---
 src/main.rs | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index 9276f6b..de75620 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -57,7 +57,16 @@ impl EventHandler for Handler {
             let mut iter = msg.content.chars();
             iter.by_ref().nth(5);
             let topic = iter.as_str();
-            create_motion(&ctx, &msg, topic);
+            if topic == "" {
+                if let Err(why) = msg.channel_id.say(
+                    &ctx.http,
+                    "If there's something you want to motion, put it after the !move keyword",
+                ) {
+                    println!("Error sending message: {:?}", why);
+                }
+            } else {
+                create_motion(&ctx, &msg, topic);
+            }
         } else if msg.content.starts_with("!motion") {
             if let Err(why) = msg.channel_id.say(&ctx.http, "I hope you're not having a motion. You may have wanted to !move something instead.") {
                 println!("Error sending message: {:?}", why);
-- 
GitLab