Add conditionals for API messages and empty usernames

This commit is contained in:
TheHolyRoger
2020-10-20 21:57:19 +01:00
parent 49e51d0f03
commit 671ed3c9b3

View File

@@ -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
}