Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TeleConfig ¶
type TeleConfig struct { // Token is the OAuth token for pushing messages. Token string `json:"Token"` // SubChannels is the list of channels for posting messages. // // Each channel must start with an `@` symbol. For example: @astra_alert SubChannels []string `json:"SubChannels"` // MessageQueueSize specifies the message queue size. MessageQueueSize int `json:"MessageQueueSize"` // EnabledMessageTypes specifies which message types are allowed to be posted. EnabledMessageTypes map[string]bool `json:"EnabledMessageTypes"` }
TeleConfig consists of configurations of the TeleHook.
func DefaultConfig ¶
func DefaultConfig() TeleConfig
func (TeleConfig) IsValid ¶
func (cfg TeleConfig) IsValid() (bool, error)
IsValid checks if the current TeleConfig is valid.
type TeleHook ¶
TeleHook implements a Telegram webhook for pushing messages.
func NewTeleHook ¶
func NewTeleHook(cfg TeleConfig, log logger.Logger) (*TeleHook, error)
NewTeleHook creates a new TeleHook with the given TeleConfig.
Click to show internal directories.
Click to hide internal directories.