From 36f278fab7cf222a050b3e982ef86d1202a7ed0d Mon Sep 17 00:00:00 2001 From: Alexey Yerin Date: Mon, 17 May 2021 22:10:17 +0300 Subject: commands: ignore empty input Prior to this, when sending nothing, senpai throws the following nonsense at you: "": usage: Now empty input is ignored, preventing this from appearing (whitespace-only message should still work). --- commands.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands.go b/commands.go index fee0571..621b034 100644 --- a/commands.go +++ b/commands.go @@ -350,6 +350,10 @@ func parseCommand(s string) (command, args string) { func (app *App) handleInput(buffer, content string) error { cmdName, rawArgs := parseCommand(content) + if content == "" { + return nil + } + var chosenCMDName string var ok bool for key := range commands { -- cgit v1.2.3