From b8c90fa91acd6929018fb99421062a46c4cb8224 Mon Sep 17 00:00:00 2001 From: Yash Karandikar Date: Wed, 3 Aug 2022 14:48:52 -0500 Subject: [PATCH] Skip empty commands --- src/bot.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bot.rs b/src/bot.rs index e51ff2e..a7f4bad 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -78,6 +78,10 @@ impl anyhow::Result<()>> Bot { let content = content.trim(); if let Some((command, remainder)) = dissect(&self.prefixes, content) { tracing::debug!("Got command: {:?} -> {:?}", command, remainder); + if command.is_empty() { + tracing::debug!("Empty command, skipping..."); + return Ok(()); + } if let Some(handler) = self.commands.get(command) { let msg = Context { author,