Your ROOT_URL in app.ini is http://git.slaventius.ru/ but you are visiting http://37.143.12.169/test3k/authPostman/src/commit/cad80c407ef0eecb375f44789fe0edacfa890fdb/internal/transport/telegram/telegram.go You should set ROOT_URL correctly, otherwise the web may not work correctly.
 
 
 
 

43 lines
670 B

package telegram
import (
"log"
// transport "git.slaventius.ru/test3k/authPostman/internal/transport"
api "github.com/go-telegram-bot-api/telegram-bot-api/v5"
)
type Message struct {
api.Message
ChatID int64
Text string
}
type Service struct {
*api.BotAPI
}
func NewService(token string) *Service {
bot, err := api.NewBotAPI(token)
if err != nil {
log.Panic(err)
}
return &Service{
bot,
}
}
func (s *Service) NewMessage(chatID int64, text string) api.MessageConfig {
return api.NewMessage(chatID, text)
}
func (s *Service) SendMessage(message api.Chattable) error {
_, err := s.Send(message)
if err != nil {
return err
}
return err
}