Skip to content

Commit

Permalink
errors: provide an error bot is not channel chat member (#659)
Browse files Browse the repository at this point in the history
* errors: provide an error bot is not channel chat member

* errors: refactor
  • Loading branch information
Nash-Well authored Feb 29, 2024
1 parent df250e6 commit 5ff8b89
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ var (
ErrKickedFromChannel = NewError(403, "Forbidden: bot was kicked from the channel chat")
ErrNotStartedByUser = NewError(403, "Forbidden: bot can't initiate conversation with a user")
ErrUserIsDeactivated = NewError(403, "Forbidden: user is deactivated")
ErrNotChannelMember = NewError(403, "Forbidden: bot is not a member of the channel chat")
)

// Err returns Error instance by given description.
Expand Down Expand Up @@ -250,6 +251,8 @@ func Err(s string) error {
return ErrChannelsTooMuch
case ErrChannelsTooMuchUser.ʔ():
return ErrChannelsTooMuchUser
case ErrNotChannelMember.ʔ():
return ErrNotChannelMember
default:
return nil
}
Expand Down

0 comments on commit 5ff8b89

Please sign in to comment.