New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

github.com/dasrmipt/go-vk-api

Package Overview
Dependencies
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/dasrmipt/go-vk-api

Source
Go Modules
Version
v0.0.0-20180602083918-6b997152ceba
Version published
Created
Source

go-vk-api

GoDoc Go Report Card

Golang wrapper for VK API

Install

Install the package with:

go get github.com/urShadow/go-vk-api

Import it with:

import "github.com/urShadow/go-vk-api"

and use vk as the package name inside the code.

Example

package main

import (
	"github.com/urShadow/go-vk-api"
	"log"
	"strconv"
)

func main() {
	api := vk.New("ru")
	// set http proxy
	//api.Proxy = "localhost:8080"

	err := api.Init("TOKEN")

	if err != nil {
		log.Fatalln(err)
	}

	api.OnNewMessage(func(msg *vk.LPMessage) {
		if msg.Flags&vk.FlagMessageOutBox == 0 {
			if msg.Text == "/hello" {
				api.Messages.Send(vk.RequestParams{
					"peer_id":          strconv.FormatInt(msg.FromID, 10),
					"message":          "Hello!",
					"forward_messages": strconv.FormatInt(msg.ID, 10),
				})
			}
		}
	})

	api.RunLongPoll()
}

FAQs

Package last updated on 02 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts