Skip to content

Commit

Permalink
Add conditionals for API messages and empty usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHolyRoger committed Oct 20, 2020
1 parent b30bb02 commit e20e90d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit e20e90d

Please sign in to comment.