Skip to content

Commit

Permalink
fix(api): also handle tg.Channel
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Apr 18, 2024
1 parent 1a822cd commit 9cfb1d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/api/badge.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func (s Server) GetTelegramBadge(ctx context.Context, params oas.GetTelegramBadg
switch c := chat.(type) {
case *tg.Chat:
members = c.ParticipantsCount
case *tg.Channel:
members = c.ParticipantsCount
default:
zctx.From(ctx).Warn("unexpected chat type",
zap.String("type", fmt.Sprintf("%T", chat)),
Expand Down

0 comments on commit 9cfb1d2

Please sign in to comment.