From 671ed3c9b3eafda66d9b286930ca11d50777da22 Mon Sep 17 00:00:00 2001 From: TheHolyRoger Date: Tue, 20 Oct 2020 21:57:19 +0100 Subject: [PATCH] Add conditionals for API messages and empty usernames --- gateway/gateway.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/gateway.go b/gateway/gateway.go index 20bd80ea..1ad8c2db 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -455,7 +455,7 @@ func (gw *Gateway) SendMessage( } // Skip empty messages. - if len(strings.TrimSpace(msg.Text)) < 1 { + if msg.Protocol != apiProtocol && len(strings.TrimSpace(msg.Text)) < 1 && len(strings.TrimSpace(msg.Username)) < 1 { return "", nil }