Skip to content

Commit

Permalink
Avoid breaking for loop if sending one user fails
Browse files Browse the repository at this point in the history
  • Loading branch information
DearRude committed Apr 28, 2024
1 parent 845a289 commit 620bb93
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions handlers/handle_commands.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package handlers

import (
"fmt"
"gorm.io/gorm"
"strconv"
"strings"
Expand Down Expand Up @@ -879,11 +878,8 @@ func messageEventCommand(u in.UpdateMessage) error {

for _, ticket := range tickets {
peer := toInputPeerUser(ticket.User)
if _, err := sender.To(&peer).StyledText(u.Ctx, in.MessageMessageEventSend(ticket.User.FirstName, params[1])...); err != nil {
if err := reactToMessage(u, "👎"); err != nil {
return err
}
return fmt.Errorf("could not send message to user: %w", err)
if _, _ = sender.To(&peer).StyledText(u.Ctx, in.MessageMessageEventSend(ticket.User.FirstName, params[1])...); err != nil {
_ = reactToMessage(u, "👎")
}
}
if err := reactToMessage(u, "👍"); err != nil {
Expand Down

0 comments on commit 620bb93

Please sign in to comment.