1
0
mirror of https://github.com/ManyakRus/starter.git synced 2025-11-23 22:45:11 +02:00

сделал EscapeString()

This commit is contained in:
Nikitin Aleksandr
2024-11-21 10:20:21 +03:00
parent 75b0af4a4d
commit d37545f111
2 changed files with 5 additions and 2 deletions

View File

@@ -24,8 +24,6 @@ build:
clear clear
./make_version.sh ./make_version.sh
go build -race -o $(FILEAPP) $(FILEMAIN) go build -race -o $(FILEAPP) $(FILEMAIN)
cd ./cmd && \
./VersionToFile.py
lint: lint:
clear clear
go fmt ./... go fmt ./...

View File

@@ -8,6 +8,7 @@ import (
"github.com/ManyakRus/starter/micro" "github.com/ManyakRus/starter/micro"
"github.com/ManyakRus/starter/stopapp" "github.com/ManyakRus/starter/stopapp"
botapi "github.com/go-telegram-bot-api/telegram-bot-api/v5" botapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"html"
"os" "os"
"sync" "sync"
) )
@@ -141,6 +142,10 @@ func SendMessage(UserName string, Text string) (int, error) {
var ID int var ID int
var err error var err error
//экранируем запрещённые символы
Text = html.EscapeString(Text)
//
msg := botapi.NewMessageToChannel(UserName, Text) msg := botapi.NewMessageToChannel(UserName, Text)
msg.ParseMode = "HTML" msg.ParseMode = "HTML"