Skip to content

Commit

Permalink
refactor: escape special characters in modem messages
Browse files Browse the repository at this point in the history
  • Loading branch information
damonto committed Jun 18, 2024
1 parent b523acc commit 842a134
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/app/handler/modem.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/damonto/telegram-sms/internal/pkg/lpac"
"github.com/damonto/telegram-sms/internal/pkg/modem"
"github.com/damonto/telegram-sms/internal/pkg/util"
"gopkg.in/telebot.v3"
)

Expand Down Expand Up @@ -63,5 +64,5 @@ EID: %s
fmt.Sprintf("`%s`", ICCID),
fmt.Sprintf("`%s`", EID)) + "\n"
}
return c.Send(strings.TrimRight(message, "\n"), &telebot.SendOptions{ParseMode: telebot.ModeMarkdownV2})
return c.Send(util.EscapeText(strings.TrimRight(message, "\n")), &telebot.SendOptions{ParseMode: telebot.ModeMarkdownV2})
}

0 comments on commit 842a134

Please sign in to comment.