telegram

package
v0.0.0-...-4b72d78 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	AlertGroupID   string
	CommandGroupID string
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Bot, error)

func (*Bot) PollUpdatesToChan

func (b *Bot) PollUpdatesToChan(camIndex int, c chan jobs.Cmd)

func (*Bot) SendEvents

func (b *Bot) SendEvents(labels []string, data io.Reader, isAlert bool) error

SendEvents sends pics to Telegram

func (*Bot) SendImageBytesBuf

func (b *Bot) SendImageBytesBuf(imgBytes *bytes.Buffer) error

func (*Bot) SendImageBytesBufCaption

func (b *Bot) SendImageBytesBufCaption(label string, data io.Reader) error

func (*Bot) SendMsg

func (b *Bot) SendMsg(msg string) error

SendMsg sends a message

func (*Bot) UpdateToCmd

func (b *Bot) UpdateToCmd(update tgbotapi.Update) jobs.Cmd

type Config

type Config struct {
	Token          string
	AlertGroupID   string
	CommandGroupID string
	Debug          bool
}

Jump to

Keyboard shortcuts

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