telegrambot

package
v0.0.0-...-9c1f1a2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: MIT Imports: 10 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 {
	AdminNickname string
	DB            *TargetsDB
	TgBot         *tgbotapi.BotAPI
	Monitor       *monitor.Monitor
	// contains filtered or unexported fields
}

func (*Bot) Dispatch

func (b *Bot) Dispatch(update *tgbotapi.Update)

func (*Bot) MonitorStart

func (b *Bot) MonitorStart()

func (*Bot) Run

func (b *Bot) Run() error

func (*Bot) SendDialogMessage

func (b *Bot) SendDialogMessage(replyTo *tgbotapi.Message, message string)

func (*Bot) SendMessage

func (b *Bot) SendMessage(chatID int64, message string)

func (*Bot) StartDialog

func (b *Bot) StartDialog(update *tgbotapi.Update, dialog dialog)

type Record

type Record struct {
	ID     uint `gorm:"primary_key"`
	ChatID int64
	Title  string
	URL    string
}

func (*Record) ToTarget

func (r *Record) ToTarget() monitor.Target

type TargetsDB

type TargetsDB struct {
	DB *gorm.DB
}

func (*TargetsDB) CreateTarget

func (t *TargetsDB) CreateTarget(record Record) error

func (*TargetsDB) DeleteTarget

func (t *TargetsDB) DeleteTarget(id int) error

func (*TargetsDB) GetCurrentTargets

func (t *TargetsDB) GetCurrentTargets(chatID int64) ([]Record, error)

func (*TargetsDB) GetTarget

func (t *TargetsDB) GetTarget(id int) (*Record, error)

func (*TargetsDB) GetTargets

func (t *TargetsDB) GetTargets() ([]monitor.Target, error)

func (*TargetsDB) Migrate

func (t *TargetsDB) Migrate()

Directories

Path Synopsis
bin

Jump to

Keyboard shortcuts

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