Skip to content

Commit

Permalink
fixing ignore commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksym Bilan committed Dec 30, 2024
1 parent 250bfd8 commit 5560625
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
9 changes: 3 additions & 6 deletions internal/app/messaging.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ func setOutputTextWithButtons(textID string, buttons []botservice.BotResultTextB
}

// Send the output messages
//
//coverage:ignore
func sendOutputMessages(session *Session) {
//coverage:ignore
if len(session.Job.Output) == 0 {
return
}
Expand All @@ -43,16 +42,14 @@ func sendOutputMessages(session *Session) {
}

// Send the output messages
//
//coverage:ignore
func sendJobResult(jobResult botservice.BotResult, session *Session) {
//coverage:ignore
bot.SendResult(session.User.ChatID, jobResult)
}

// Send a message to the user (Immediately)
//
//coverage:ignore
func sendMessage(textID string, session *Session) {
//coverage:ignore
locale := session.Locale()
chatID := session.User.ChatID

Expand Down
3 changes: 1 addition & 2 deletions internal/app/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,8 @@ func handleSession(session *Session) {
}

// Finish the session. Send the output to the user
//
//coverage:ignore
func finishSession(session *Session) {
//coverage:ignore
// Save the user's data
session.SaveUser(userStorage)
// Prepare the messages, localize and send it
Expand Down
2 changes: 1 addition & 1 deletion internal/app/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func updateUser(user *database.User, ctx *context.Context, userStorage database.
return fetchedUser
}

//coverage:ignore
func saveUser(user *database.User, ctx *context.Context, userStorage database.UserStorage) {
//coverage:ignore
err := userStorage.SaveUser(ctx, *user)
if err != nil {
log.Printf("[User] Error saving user to firestore, %s", err.Error())
Expand Down
8 changes: 4 additions & 4 deletions third_party/telegram/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ type Telegram struct{}

var baseURL string

//coverage:ignore
func init() {
//coverage:ignore
baseURL = "https://api.telegram.org/bot" + os.Getenv("CAPY_TELEGRAM_BOT_TOKEN")
}

Expand Down Expand Up @@ -86,13 +86,13 @@ func (t Telegram) Parse(body io.ReadCloser) *botservice.BotMessage {
return &message
}

//coverage:ignore
func (t Telegram) SendMessage(chatID int64, text string) {
//coverage:ignore
sendMessage(chatID, text, nil)
}

//coverage:ignore
func (t Telegram) SendResult(chatID int64, result botservice.BotResult) {
//coverage:ignore
// Prepare the reply markup
var replyMarkup *InlineKeyboardMarkup
if len(result.Buttons) > 0 {
Expand All @@ -112,8 +112,8 @@ func (t Telegram) SendResult(chatID int64, result botservice.BotResult) {
sendMessage(chatID, result.Text(), replyMarkup)
}

//coverage:ignore
func sendMessage(chatID int64, text string, replyMarkup *InlineKeyboardMarkup) {
//coverage:ignore
var url string = baseURL + "/sendMessage"

message := SendMessageRequest{
Expand Down

0 comments on commit 5560625

Please sign in to comment.