Skip to content

Commit

Permalink
Don't give error msg in group chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Divkix committed Apr 1, 2022
1 parent 6ecee50 commit 1ec86dd
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,20 +208,12 @@ func restrictChannels(bot *gotgbot.Bot, ctx *ext.Context) error {

_, err := msg.Delete(bot)
if err != nil {
_, err := msg.Reply(bot, "Failed to delete message: "+err.Error(), nil)
if err != nil {
fmt.Println("[RestrictChannels] Failed to reply:", err.Error())
}
fmt.Println("[RestrictChannels] Failed to delete message:", err.Error())
return err
}

_, err = chat.BanSenderChat(bot, sender.Id())
if err != nil {
_, err := msg.Reply(bot, "Failed to ban sender: "+err.Error(), nil)
if err != nil {
fmt.Println("[RestrictChannels] Failed to reply:", err.Error())
}
fmt.Println("[RestrictChannels] Failed to ban sender:", err.Error())
return err
}
Expand Down

0 comments on commit 1ec86dd

Please sign in to comment.