adapter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 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 Bot

type Bot struct {
	// contains filtered or unexported fields
}

func (*Bot) GetFirstName

func (b *Bot) GetFirstName() string

func (*Bot) GetUpdatesChan

func (b *Bot) GetUpdatesChan(webhookURL string, listenAddr string) (<-chan *model.Message, error)

func (*Bot) GetUserName

func (b *Bot) GetUserName() string

func (*Bot) Send

func (b *Bot) Send(m *model.Message) error

func (*Bot) SendRaw added in v0.4.1

func (b *Bot) SendRaw(endpoint string, params map[string]string) error

type BotAdapter

type BotAdapter interface {
	Send(*model.Message) error
	SendRaw(string, map[string]string) error
	GetUpdatesChan(string, string) (<-chan *model.Message, error)
	GetUserName() string
	GetFirstName() string
}

func CreateBot

func CreateBot(token string, httpClient *http.Client) (BotAdapter, error)

Jump to

Keyboard shortcuts

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