telegram

package
v0.0.0-...-058b651 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Telegram

type Telegram struct {
	// Bot is the handler which handles the message sent by users
	Bot *tb.Bot

	// AuthorizedUsers is a authorized users slice.
	AuthorizedUsers []*provider.User
	// contains filtered or unexported fields
}

Telegram contains all variables needed to make a stable connection with the Telegram API.

func (*Telegram) GetLabel

func (t *Telegram) GetLabel() string

GetLabel returns the label of the provider

func (*Telegram) Initialize

func (t *Telegram) Initialize(config *provider.Config) (provider.Provider, error)

Initialize initiliazes a provider with the given label, api token, slice of authorized users and user inputs write-only channel.

func (*Telegram) Message

func (t *Telegram) Message(capsule *capsule.Capsule) error

Message sends the text message to the user.

func (*Telegram) Start

func (t *Telegram) Start()

Start starts the provider handlers.

func (*Telegram) Stop

func (t *Telegram) Stop()

Stop closes the user inputs channel and the telegram listener.

Jump to

Keyboard shortcuts

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