adapter

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2017 License: Apache-2.0 Imports: 4 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 *Message, error)

func (*Bot) GetUserName

func (b *Bot) GetUserName() string

func (*Bot) Send

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

type BotAdapter

type BotAdapter interface {
	Send(*Message) error
	GetUpdatesChan(string, string) (<-chan *Message, error)
	GetUserName() string
	GetFirstName() string
}

func CreateBot

func CreateBot(token string) (BotAdapter, error)

type Message

type Message struct {
	Type            MessageType
	Data            string
	Caption         string
	Replies         chan *Message
	From            string
	ChatID          int64
	DisablePreview  bool
	Markdown        bool
	Buttons         [][]string
	OneTimeKeyboard bool
}

type MessageType

type MessageType int
const (
	MessageText MessageType = iota
	MessageDocument
	MessageSticker
	MessagePhoto
	MessageAudio
	MessageKeyboard
)

Jump to

Keyboard shortcuts

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