bot

package
v0.0.0-...-2d76e61 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var COMMANDS map[string]COMMAND
View Source
var HANDLERS map[string][]func(*Event, map[string]interface{})

Functions

func CmdsInit

func CmdsInit()

func Dict

func Dict(list interface{}) map[string]interface{}

func F

func F(event *Event)

func HandleEvent

func HandleEvent(eventtype string, call func(*Event, map[string]interface{}))

func HasString

func HasString(list []interface{}, value string) bool

func Init

func Init(call func(*Event), command string, access int, bot_ids []int)

func List

func List(dict interface{}) []interface{}

func ReadFile

func ReadFile(path string) []byte

func ReadFileString

func ReadFileString(path string) string

func RunHandlers

func RunHandlers(eventtype string, event *Event, updates map[string]interface{})

func UploadFile

func UploadFile(url string, filename string, field string) map[string]interface{}

Types

type Bot

type Bot struct {
	// contains filtered or unexported fields
}

func (*Bot) Config

func (bot *Bot) Config(cfg map[string]interface{})

func (*Bot) GetBots

func (bot *Bot) GetBots(bottype string) []Bot

func (*Bot) SetBots

func (bot *Bot) SetBots(bots *[]Bot)

type COMMAND

type COMMAND struct {
	// contains filtered or unexported fields
}

type Event

type Event struct {
	// contains filtered or unexported fields
}

type File

type File struct {
	// contains filtered or unexported fields
}

func (*File) Init

func (f *File) Init(path string, filetype string) *File

type LPData

type LPData struct {
	// contains filtered or unexported fields
}

func (*LPData) GetLongPoll

func (poll *LPData) GetLongPoll(bot *Bot)

func (*LPData) Updates

func (poll *LPData) Updates(bot *Bot)

type LongPoll

type LongPoll struct {
	// contains filtered or unexported fields
}

func (*LongPoll) Init

func (lp *LongPoll) Init(bots []Bot)

func (*LongPoll) Listen

func (lp *LongPoll) Listen()

Jump to

Keyboard shortcuts

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