longpoll

package
v0.0.0-...-3c8687b Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeMessageNew   = "message_new"
	EventTypeMessageEvent = "message_event"
)
View Source
const (
	ActionTypeKickUser   = "chat_kick_user"
	ActionTypeInviteUser = "chat_invite_user"
	ActionTypeByLink     = "chat_invite_user_by_link"
)

Actions types.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, vk *vkapi.Client, wait int) <-chan *Event

Run runs longpoll listener and returns events channel. Channel will be closed when context is done.

Types

type ClientInfo

type ClientInfo struct {
	ButtonActions  []string `json:"button_actions"`
	Keyboard       bool     `json:"keyboard"`
	InlineKeyboard bool     `json:"inline_keyboard"`
	Carousel       bool     `json:"carousel"`
	LangID         int      `json:"lang_id"`
}

ClientInfo struct.

type Event

type Event struct {
	Object interface{}
	Type   string
}

Event struct.

func (*Event) UnmarshalJSON

func (e *Event) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type MessageEvent

type MessageEvent struct {
	Payload               vkapi.JSONData `json:"payload"`
	EventID               string         `json:"event_id"`
	UserID                vkapi.UserID   `json:"user_id"`
	PeerID                vkapi.ID       `json:"peer_id"`
	ConversationMessageID int            `json:"conversation_message_id"`
}

MessageEvent struct.

type MessageNew

type MessageNew struct {
	Message    vkapi.Message `json:"message"`
	ClientInfo ClientInfo    `json:"client_info"`
}

MessageNew struct.

Jump to

Keyboard shortcuts

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