Skip to content

Commit

Permalink
fix(api): fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Apr 18, 2024
1 parent a136a3f commit 1cbb6f0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/api/badge.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ func (s Server) GetTelegramBadge(ctx context.Context, params oas.GetTelegramBadg
}
var inputChannel tg.InputChannel
inputChannel.FillFrom(peer.(*tg.InputPeerChannel))
fullChat, err := s.tg.API().ChannelsGetFullChannel(ctx, &inputChannel)
full, err := s.tg.API().ChannelsGetFullChannel(ctx, &inputChannel)
if err != nil {
return nil, errors.Wrap(err, "get chat")
}
chanFull := full.FullChat.(*tg.ChannelFull)
s.lg.Info("Got chat",
zap.Int("chats", len(fullChat.Chats)),
zap.Int64("id", fullChat.FullChat.(*tg.ChatFull).ID),
zap.String("about", fullChat.FullChat.(*tg.ChatFull).About),
zap.Int("chats", len(full.Chats)),
zap.Int64("id", chanFull.ID),
zap.String("about", chanFull.About),
)
for _, chat := range fullChat.Chats {
for _, chat := range full.Chats {
switch c := chat.(type) {
case *tg.Chat:
members = c.ParticipantsCount
Expand Down

0 comments on commit 1cbb6f0

Please sign in to comment.