Skip empty commands

This commit is contained in:
Yash Karandikar 2022-08-03 14:48:52 -05:00 committed by lemonsh
parent ee25b6f970
commit b8c90fa91a

View file

@ -78,6 +78,10 @@ impl<SF: Fn(String, String) -> anyhow::Result<()>> Bot<SF> {
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,