telegram

package
v2.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2019 License: Apache-2.0 Imports: 2 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 {
	Bot    *tgbotapi.BotAPI
	Config BotConfig
}

Bot telegram interaction client

func NewBot

func NewBot(c BotConfig) (*Bot, error)

NewBot creates new telegram bot

func (*Bot) GetUpdatesChannel

func (b *Bot) GetUpdatesChannel() (tgbotapi.UpdatesChannel, error)

GetUpdatesChannel gets new updates updates

func (*Bot) SendMessage

func (b *Bot) SendMessage(m Message) error

SendMessage sends a telegram message

type BotConfig

type BotConfig struct {
	Token          string
	Debug          bool
	UpdatesTimeout int
}

BotConfig configuration of the bot

type Message

type Message struct {
	ChatID    int
	MessageID int
	Text      string
}

Message a telegram message struct

Jump to

Keyboard shortcuts

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