telegram

package
v0.0.0-...-c3423aa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package telegram is the telegram notification package.

Index

Constants

View Source
const (
	// MaxMessageLength is the max message length of a Telegram bot
	MaxMessageLength = 4096
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NotifyConfig

type NotifyConfig struct {
	base.DefaultNotify `yaml:",inline"`
	Token              string `yaml:"token" json:"token" jsonschema:"required,title=Telegram Bot Token,description=Telegram Bot Token"`
	ChatID             string `yaml:"chat_id" json:"chat_id" jsonschema:"required,title=Telegram Chat ID,description=Telegram Group ID or Channel ID"`
}

NotifyConfig is the telegram notification configuration

func (*NotifyConfig) Config

func (c *NotifyConfig) Config(gConf global.NotifySettings) error

Config configures the telegram configuration

func (*NotifyConfig) SendTelegram

func (c *NotifyConfig) SendTelegram(title, text string) error

SendTelegram is the wrapper for SendTelegramNotification

func (*NotifyConfig) SendTelegramNotification

func (c *NotifyConfig) SendTelegramNotification(text string) error

SendTelegramNotification will send the notification to telegram.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL