29 lines
758 B
Go
29 lines
758 B
Go
package services
|
|
|
|
import "ticket-pimp/internal/domain"
|
|
|
|
type DummyTelegram struct {
|
|
*CommonClient
|
|
config domain.TelegramConfig
|
|
}
|
|
|
|
type TelegramMessage struct {
|
|
ChatID string `json:"chat_id"`
|
|
Text string `json:"text"`
|
|
DisableNotification bool `json:"disable_notification"`
|
|
ParseMode string `json:"parse_mode"`
|
|
DisablePreview bool `json:"disable_web_page_preview"`
|
|
}
|
|
|
|
func (tg *DummyTelegram) DummyNotification(id string, text string) {
|
|
tg.R().
|
|
SetBody(&TelegramMessage{
|
|
ChatID: id,
|
|
Text: text,
|
|
DisableNotification: true,
|
|
ParseMode: "HTML",
|
|
DisablePreview: true,
|
|
}).
|
|
Post("https://api.telegram.org/bot" + tg.config.Token + "/sendMessage")
|
|
}
|