bot

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 1 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 interface {
	Handle(command string, h HandlerFunc)
	Send(userId int64, text string, opts ...interface{}) (e *Editable, err error)
	SendPhoto(userId int64, photo *Photo, opts ...interface{}) (e *Editable, err error)
	SendDocument(userId int64, filename string) error
	Edit(edit *Editable, text string, opts ...interface{}) (e *Editable, err error)
	Delete(edit *Editable) error
	Start()
	Stop()
}

type BtnContext

type BtnContext interface {
	UserId() int64
	Unique() string
	Data() string
}

type Context

type Context interface {
	UserId() int64
}

type Editable

type Editable struct {
	MessageID int   `json:"message_id"`
	ChatID    int64 `json:"chat_iD"`
}

func (*Editable) MessageSig

func (e *Editable) MessageSig() (messageID string, chatID int64)

type HandlerFunc

type HandlerFunc func(Context) error

type Inline

type Inline struct {
	ItemsPerRow int
	Handler     InlineHandler
	// contains filtered or unexported fields
}

func NewInline

func NewInline(itemsPerRow int, handler InlineHandler) *Inline

func (*Inline) Add

func (i *Inline) Add(text string, unique string, data string)

func (*Inline) GetBtns

func (i *Inline) GetBtns() []*InlineBtn

type InlineBtn

type InlineBtn struct {
	Text   string
	Unique string
	Data   string
}

type InlineHandler

type InlineHandler func(BtnContext) error

type Photo

type Photo struct {
	Filename string
	Caption  string
}

type UserProfile

type UserProfile struct {
	ID int64 `json:"id"`
}

func (*UserProfile) Recipient

func (p *UserProfile) Recipient() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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