Skip to content

Commit

Permalink
Force update avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
grulex committed Oct 23, 2023
1 parent 98419b5 commit 2cf56de
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (s TelegramBot) Start() error {
go func() {
err := s.checkAvatar(ctx, update.MyChatMember.From.ID)
if err != nil {
s.sendErrorToChat(update.MyChatMember.Chat.ID)
log.Println(err)
}
}()

Expand Down Expand Up @@ -205,12 +205,10 @@ func (s TelegramBot) checkAvatar(ctx context.Context, tgUserID int64) error {
return err
}
wishlist := wishlists.GetDefault()
if wishlist.Avatar == nil {
wishlist.Avatar = &avatar.ID
err = s.container.Wishlist.Update(ctx, wishlist)
if err != nil {
return err
}
wishlist.Avatar = &avatar.ID
err = s.container.Wishlist.Update(ctx, wishlist)
if err != nil {
return err
}

return nil
Expand Down

0 comments on commit 2cf56de

Please sign in to comment.