Closed region23 closed 9 months ago
You can try sending a message and check if the err is equal to ErrBlockedByUser
.
msg, err := b.Send(&tele.User{ID: id}, "Hello")
if err != nil {
fmt.Println(err)
}
fmt.Println(err == tele.ErrBlockedByUser)
I blocked the bot and tried to send a Message, and in this case, it printed true in console:
How to check that user blocked and stop bot? Can't found this in docs or code.