Documentation ¶
Index ¶
Constants ¶
const ( ModeMarkdown = tgbotapi.ModeMarkdown ModeHTML = tgbotapi.ModeHTML )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Telegram ¶
type Telegram struct {
// contains filtered or unexported fields
}
Telegram struct holds necessary data to communicate with the Telegram API.
func New ¶
New returns a new instance of a Telegram notification service. For more information about telegram api token:
-> https://pkg.go.dev/github.com/go-telegram-bot-api/telegram-bot-api#NewBotAPI
func (*Telegram) AddReceivers ¶
AddReceivers takes Telegram chat IDs and adds them to the internal chat ID list. The Send method will send a given message to all those chats.
func (Telegram) Send ¶
Send takes a message subject and a message body and sends them to all previously set chats. Message body supports html as markup language.
func (*Telegram) SetClient ¶ added in v0.40.0
SetClient set a new custom BotAPI instance. For example allowing you to use NewBotAPIWithClient:
-> https://pkg.go.dev/github.com/go-telegram-bot-api/telegram-bot-api#NewBotAPIWithClient
func (*Telegram) SetParseMode ¶ added in v0.30.0
SetParseMode sets the parse mode for the message body. For more information about telegram constants:
-> https://pkg.go.dev/github.com/go-telegram-bot-api/telegram-bot-api#pkg-constants