Skip to content

Commit

Permalink
Merge pull request #3 from terratensor/develop
Browse files Browse the repository at this point in the history
Fixed net/url: invalid control character in URL Text: \r
  • Loading branch information
audetv authored Aug 10, 2023
2 parents fde71d7 + 7ceca0d commit 5c01d7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion consumer/internal/infra/msgsender/msgsender.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import (
"log"
"net/http"
"os"
"strings"
"tg-svodd-bot/consumer/internal/domain/message"
"time"
)

func Send(ctx context.Context, text string) {

contents, _ := os.ReadFile(os.Getenv("TG_BOT_TOKEN_FILE"))
token := fmt.Sprintf("%v", string(contents))
token := fmt.Sprintf("%v", strings.Trim(string(contents), "\r\n"))

url := fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage",
token)
Expand Down

0 comments on commit 5c01d7b

Please sign in to comment.