Skip empty commands
This commit is contained in:
parent
ee25b6f970
commit
b8c90fa91a
|
@ -78,6 +78,10 @@ impl<SF: Fn(String, String) -> anyhow::Result<()>> Bot<SF> {
|
||||||
let content = content.trim();
|
let content = content.trim();
|
||||||
if let Some((command, remainder)) = dissect(&self.prefixes, content) {
|
if let Some((command, remainder)) = dissect(&self.prefixes, content) {
|
||||||
tracing::debug!("Got command: {:?} -> {:?}", command, remainder);
|
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) {
|
if let Some(handler) = self.commands.get(command) {
|
||||||
let msg = Context {
|
let msg = Context {
|
||||||
author,
|
author,
|
||||||
|
|
Loading…
Reference in a new issue