telegram

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: GPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Message string `json:"message"`
}

Message is the message the bot can send it needs to be of type: TelegramNotificationCommandType

type Telegram

type Telegram struct {
	chik.BaseHandler
	Token            string            `json:"token" mapstructure:"token"`
	AllowedUsers     []string          `json:"allowed_users" mapstructure:"allowed_users"`
	AppliancesByName map[string]string `json:"appliances_by_name" mapstructure:"appliances_by_name"`
	SetStrings       []string          `json:"set_strings" mapstructure:"set_strings"`
	ResetStrings     []string          `json:"reset_strings" mapstructure:"reset_strings"`
	SetDoneMessage   string            `json:"set_done_message" mapstructure:"set_done_message"`
	ReseDonetMessage string            `json:"reset_done_message" mapstructure:"reset_done_message"`
	// contains filtered or unexported fields
}

Telegram handler

func New

func New() *Telegram

New creates a telegram handler. useful for sending notifications about events

func (*Telegram) HandleChannelEvent added in v1.6.0

func (h *Telegram) HandleChannelEvent(event interface{}, controller *chik.Controller) error

func (*Telegram) HandleMessage

func (h *Telegram) HandleMessage(message *chik.Message, controller *chik.Controller) error

func (*Telegram) HandleTimerEvent added in v1.6.0

func (h *Telegram) HandleTimerEvent(tick time.Time, controller *chik.Controller) error

func (*Telegram) Setup added in v1.6.0

func (h *Telegram) Setup(controller *chik.Controller) (chik.Interrupts, error)

func (*Telegram) String

func (h *Telegram) String() string

func (*Telegram) Teardown

func (h *Telegram) Teardown()

func (*Telegram) Topics

func (h *Telegram) Topics() []types.CommandType

Jump to

Keyboard shortcuts

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