bot

package
v0.0.0-...-6e4ec00 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2019 License: GPL-3.0 Imports: 11 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
}

Bot a bot

var DefaultBot *Bot

DefaultBot and only one bot here

func NewBot

func NewBot() *Bot

NewBot for create

func (*Bot) AnswerCallbackQuery

func (b *Bot) AnswerCallbackQuery(c tgApi.CallbackConfig) (tgApi.APIResponse, error)

AnswerCallbackQuery wrapper

func (*Bot) Connect

func (b *Bot) Connect(conf config.Config) error

Connect to bot

func (*Bot) DeleteMessage

func (b *Bot) DeleteMessage(config tgApi.DeleteMessageConfig) (tgApi.APIResponse, error)

DeleteMessage wrapper

func (*Bot) GifMessage

func (b *Bot) GifMessage(to int64, langSet, key, imageID string,
	obj interface{}, mk ...tgApi.InlineKeyboardMarkup) (tgApi.Message, error)

GifMessage is

func (*Bot) GifReply

func (b *Bot) GifReply(to int64, langSet, key, imageID string, replyTo int,
	obj interface{}, mk ...tgApi.InlineKeyboardMarkup) (tgApi.Message, error)

GifReply is

func (*Bot) ID

func (b *Bot) ID() int

ID of bot

func (*Bot) LeaveChat

func (b *Bot) LeaveChat(c tgApi.ChatConfig) (tgApi.APIResponse, error)

LeaveChat wrapper

func (*Bot) MarkdownMessage

func (b *Bot) MarkdownMessage(to int64, langSet, key string,
	obj interface{}, mk ...tgApi.InlineKeyboardMarkup) (tgApi.Message, error)

MarkdownMessage is

func (*Bot) MarkdownReply

func (b *Bot) MarkdownReply(to int64, langSet, key string, replyTo int,
	obj interface{}, mk ...tgApi.InlineKeyboardMarkup) (tgApi.Message, error)

MarkdownReply is

func (*Bot) Name

func (b *Bot) Name() string

Name of bot

func (*Bot) RegisterProcessor

func (b *Bot) RegisterProcessor(fn ProceedFunc)

RegisterProcessor to reg some func.

func (*Bot) Run

func (b *Bot) Run()

Run to proceed

func (*Bot) Send

func (b *Bot) Send(c tgApi.Chattable) (tgApi.Message, error)

Send message to tg

type ProceedFunc

type ProceedFunc func(tgApi.Update, *Bot)

ProceedFunc recv and reply

Jump to

Keyboard shortcuts

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