Migration to Tongo, new logic for user storage #3
@ -51,10 +51,14 @@ func TaskNotifyUsers(b *echotron.API) {
 | 
			
		||||
			text := fmt.Sprintf("*[%s](tg://user?id=%d)*, напоминаю, что тебе необходимо пройти капчу\\!", EscapeText(echotron.MarkdownV2, user.FirstName), user.Id)
 | 
			
		||||
			store.ReplaceItem(ctx, *user, false)
 | 
			
		||||
			chat, err := chatStore.GetOne(ctx, tongo.E("chat_id", user.ChatId))
 | 
			
		||||
			topic := 0
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				log.Printf("Can't get chat from user: %s", err)
 | 
			
		||||
				return
 | 
			
		||||
			} else {
 | 
			
		||||
				topic = int(chat.TopicId)
 | 
			
		||||
			}
 | 
			
		||||
			res, err := b.SendMessage(text, user.ChatId, &echotron.MessageOptions{MessageThreadID: int(chat.TopicId), ParseMode: echotron.MarkdownV2})
 | 
			
		||||
			res, err := b.SendMessage(text, user.ChatId, &echotron.MessageOptions{MessageThreadID: topic, ParseMode: echotron.MarkdownV2})
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				log.Printf("Can't send notification to user: %s", err)
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user