You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
670 B

2 years ago
package telegram
import (
2 years ago
"log"
// transport "git.slaventius.ru/test3k/authPostman/internal/transport"
2 years ago
api "github.com/go-telegram-bot-api/telegram-bot-api/v5"
)
2 years ago
type Message struct {
api.Message
ChatID int64
Text string
}
2 years ago
type Service struct {
*api.BotAPI
}
2 years ago
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
2 years ago
}