func (server *UserLongPollServer) Init() (err error) {
	r := UserLongPollServerResponse{}
	pts := 0
	if server.NeedPts {
		pts = 1
	}
	err = API.CallMethod("messages.getLongPollServer", H{
		"need_pts": strconv.Itoa(pts),
		"message":  strconv.Itoa(server.LpVersion),
	}, &r)
	server.Wait = DefaultWait
	server.Mode = DefaultMode
	server.Version = DefaultVersion
	server.RequestInterval = API.RequestInterval
	server.Server = r.Response.Server
	server.Ts = r.Response.Ts
	server.Key = r.Response.Key
	return err
}
Init - init longpoll server
package govkbot
import (
	"encoding/json"
	"errors"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
	"strconv"
	"strings"
	"time"
	"github.com/labstack/gommon/log"
)
const DefaultWait = 25
const (
	LongPollModeGetAttachments    = 2
	LongPollModeGetExtendedEvents = 8
	LongPollModeGetPts            = 32
	LongPollModeGetExtraData      = 64
	LongPollModeGetRandomID       = 128
)
const DefaultMode = LongPollModeGetAttachments
const DefaultVersion = 2
const ChatPrefix = 2000000000
type LongPollServer interface {
	Init() (err error)
	Request() ([]byte, error)
	GetLongPollMessages() ([]*Message, error)
	FilterReadMesages(messages []*Message) (result []*Message)
}
type UserLongPollServer struct {
	Key             string
	Server          string
	Ts              int
	Wait            int
	Mode            int
	Version         int
	RequestInterval int
	NeedPts         bool
	API             *VkAPI
	LpVersion       int
	ReadMessages    map[int]time.Time
}
type UserLongPollServerResponse struct {
	Response UserLongPollServer
}
type LongPollUpdate []interface{}
type LongPollUpdateNum []int64
type LongPollResponse struct {
	Ts       uint
	Messages []*Message
}
type Attachment struct {
	AttachType      string
	Attach          string
	Fwd             string
	From            int
	Geo             int
	GeoProvider     int
	Title           string
	AttachProductID int
	AttachPhoto     string
	AttachTitle     string
	AttachDesc      string
	AttachURL       string
	Emoji           bool
	FromAdmin       int
	SourceAct       string
	SourceMid       int
}
type LongPollMessage struct {
	MessageType int
	MessageID   int
	Flags       int
	PeerID      int64
	Timestamp   int64
	Text        string
	Attachments []Attachment
	RandomID    int
}
type FailResponse struct {
	Failed     int
	Ts         int
	MinVersion int `json:"min_version"`
	MaxVersion int `json:"max_version"`
}
func NewUserLongPollServer(needPts bool, lpVersion int, requestInterval int) (resp *UserLongPollServer) {
	server := UserLongPollServer{}
	server.NeedPts = needPts
	server.Wait = DefaultWait
	server.Mode = DefaultMode
	server.Version = DefaultVersion
	server.RequestInterval = requestInterval
	server.LpVersion = lpVersion
	server.ReadMessages = make(map[int]time.Time)
	return &server
}