vkgo

module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT

README

Bots Community

Flexible and high-performance VK API module Go

Instalation

go get github.com/cyngularitydev/vkgo

Getting started

Examples of working bots can be seen in the catalog /samples

A simple example of a LongPoll API Bot:

package main

import (
	"github.com/cyngularitydev/vkgo/api"
	"github.com/cyngularitydev/vkgo/longpoll"
	"github.com/cyngularitydev/vkgo/scene"
	"github.com/cyngularitydev/vkgo/update"
	"log"
	"os"
)

func main() {
	bot, err := api.NewBot(os.Getenv("TOKEN"))
	if err != nil { /* ... */
	}

	messages := scene.OnMessage(func(bot *api.API, message update.Message) {
		bot.SendMessage(message.ChatID, message.Text)
	})

	log.Fatalln(longpoll.Start(bot, messages))
}

Help in solving problems

Don't know how to solve your problem? Ask the programmers from our community. There is a chance that they have already dealt with this problem and are ready to help you

Directories

Path Synopsis
samples
callback-bot command
community-bot command
longpoll-bot command
multi-bot command

Jump to

Keyboard shortcuts

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