vkapi

package
v0.0.0-...-f5483da Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: Zlib Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const VKApi = "https://api.vk.com/method/"

VKApi URL API сервера ВКонтакте

Variables

This section is empty.

Functions

This section is empty.

Types

type LongPollEvent

type LongPollEvent struct {
	TS      string
	Updates []LongPollEventUpdate
}

LongPollEvent описывает структуру события

type LongPollEventUpdate

type LongPollEventUpdate struct {
	Type   string
	Object *fastjson.Value
}

LongPollEventUpdate событие, но поближе

type Method

type Method struct {
	VK *VK
}

Method это сборник методов

func (*Method) GetConversationMembers

func (m *Method) GetConversationMembers(peerID int64) []byte

GetConversationMembers получает всех участников беседы

func (*Method) SendMessage

func (m *Method) SendMessage(msg string, peerID int64, enableMentions ...bool) []byte

SendMessage отправляет сообщение

func (*Method) UserGet

func (m *Method) UserGet(userID int64) []byte

UserGet получает информацию об пользователе

type VK

type VK struct {
	Token   string
	GroupID string
	Method  Method
}

VK структура для VKApi

func (*VK) Init

func (v *VK) Init(token, groupid string)

Init инициализирует структуру VK

func (*VK) ListenLongPoll

func (v *VK) ListenLongPoll() LongPollEvent

ListenLongPoll получает последние события

func (*VK) ParseLongPollEvent

func (v *VK) ParseLongPollEvent(event string) LongPollEvent

ParseLongPollEvent переводит JSON-представление события в структуру LongPollEvent

func (*VK) Request

func (v *VK) Request(method string, args map[string]string) []byte

Request функция для совершения запросов к VKApi

Jump to

Keyboard shortcuts

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