longpoll

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("bot not found")
	ErrSessionClosed = errors.New("session closed")
)

Functions

func Start

func Start(properties ...any) *responses.Error

Types

type LongPoll

type LongPoll struct {
	Bot     *api.Bot
	Session *responses.LongPollServer
	Scenes  *scene.Scenes
	Timeout int
	Mode    int
	BotType int // 1 - community, 2 - user
}

LongPoll - basic configuration structure Bot - pointer to the bot parameters Session - pointer to the session, received from the Create function Scenes - pointer to the list of scenes to process the types of events Timeout - time of waiting for the next request.

func New

func New(properties ...any) (*LongPoll, *responses.Error)

func (*LongPoll) SetScenes

func (lp *LongPoll) SetScenes(scenes *scene.Scenes) *LongPoll

func (*LongPoll) SetTimeout

func (lp *LongPoll) SetTimeout(time int) *LongPoll

func (*LongPoll) Start

func (lp *LongPoll) Start() *responses.Error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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