api

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	ID          int     `json:"id"`
	Token       string  `json:"token"`
	Version     float32 `json:"version"`
	IsGroup     bool    `json:"is_group"`
	Deprecated  Deprecated
	ContentType string
	Limit       int

	*botsgo.Bot
	// contains filtered or unexported fields
}

Bot ✨ is an object that defines the properties of a bot 🏙️ The ID is the unique identifier of the bot. It contains either a community ID or a user page ID 🏡 A token is a key to access your application (bot) ☕ Version - VK API version, it is strongly recommended to set 5.154000 📺 IsGroup is set automatically, guided by the information about the created bot 🧢 Logger is a pointer to the Logger object of the zap library. Used during development to detect problems during operation 👆 ContentType a simpler format of response data — https://en.wikipedia.org/wiki/MessagePack 💕 Limit - limiting the number of requests per second depending on the type of bot 🌿 errorHandler performs the task of transmitting an error for further processing.

func New

func New(properties ...any) (*Bot, error)

New 📺 creating a page/community bot 🏙️ String - token 🎮 Float32 - version 💬 Int - page/community ID 💗 Bot{} - advanced settings 🍭 Returns an instance of the *Bot.

func NewBot

func NewBot(token string, communityID int, properties ...any) (*Bot, error)

func NewUser

func NewUser(token string, userID int, properties ...any) (*Bot, error)

func (*Bot) Ban

func (bot *Bot) Ban(objectID int) (ok bool, err *responses.Error)

func (*Bot) BanUser

func (bot *Bot) BanUser(properties ...any) (ok bool, err *responses.Error)

func (*Bot) Call

func (bot *Bot) Call(method string, queryParams string, responseStruct any) error

Call 🔥🌅 sending an API request 🌌❄ The first argument is the name of the method, 🌺🌼🌹 the second is the URL string, 🦋🌹🎲 then usually a pointer to the structure where the response will be written 🌍🌊🐠 May return an error.

func (*Bot) CreateChat

func (bot *Bot) CreateChat(properties ...any) (chatID int, users []int, err *responses.Error)

func (*Bot) DeleteMessage

func (bot *Bot) DeleteMessage(properties ...any) (message responses.DeleteMessage, err *responses.Error)

func (*Bot) DeleteMessages

func (bot *Bot) DeleteMessages(properties ...any) (messages []responses.DeleteMessage, err *responses.Error)

func (*Bot) EditMessage

func (bot *Bot) EditMessage(properties ...any) (ok bool, err *responses.Error)

func (*Bot) Execute

func (bot *Bot) Execute(properties ...any) (result any, err *responses.Error)

func (*Bot) GetBanned

func (bot *Bot) GetBanned(properties ...any) (count int, bans []int, users []responses.User, err *responses.Error)

func (*Bot) GetBannedUsers

func (bot *Bot) GetBannedUsers(properties ...any) (count int, bans []responses.BannedUser, err *responses.Error)

func (*Bot) GetChat

func (bot *Bot) GetChat(properties ...any) (chat responses.Chat)
func (bot *Bot) GetChatLink(properties ...any) (link string, err *responses.Error)

func (*Bot) GetChatMembers

func (bot *Bot) GetChatMembers(properties ...any) responses.ChatMembers

func (*Bot) GetChats

func (bot *Bot) GetChats(properties ...any) responses.Chats

func (*Bot) GetCounters

func (bot *Bot) GetCounters() (responses.Counters, *responses.Error)

func (*Bot) GetGifts

func (bot *Bot) GetGifts(properties ...any) (count int, gifts []responses.Gift, err *responses.Error)

func (*Bot) GetGroup

func (bot *Bot) GetGroup(properties ...any) (group responses.Group)

func (*Bot) GetGroupLongPollServer

func (bot *Bot) GetGroupLongPollServer(properties ...any) responses.LongPollServer

func (*Bot) GetHealth

func (bot *Bot) GetHealth() (statuses []responses.HealthStatus, err *responses.Error)

func (*Bot) GetHistoryMessages

func (bot *Bot) GetHistoryMessages(properties ...any) responses.HistoryMessages

func (*Bot) GetInfo

func (bot *Bot) GetInfo(properties ...any) responses.Info

func (*Bot) GetMessage

func (bot *Bot) GetMessage(properties ...any) (count int, message update.Message, groups []responses.Group, users []responses.User, err *responses.Error)

func (*Bot) GetMessages

func (bot *Bot) GetMessages(properties ...any) responses.Messages

func (*Bot) GetOffers

func (bot *Bot) GetOffers(properties ...any) (count int, offers []int, err *responses.Error)

func (*Bot) GetStatus

func (bot *Bot) GetStatus(properties ...any) (text string, err *responses.Error)

func (*Bot) GetStorage

func (bot *Bot) GetStorage(properties ...any) (storages responses.Storages, err *responses.Error)

func (*Bot) GetStorageKeys

func (bot *Bot) GetStorageKeys(userID int) (keys []string, err *responses.Error)

func (*Bot) GetUploadMessagesDocumentServer

func (bot *Bot) GetUploadMessagesDocumentServer(properties ...any) responses.UploadMessagesDocumentServer

func (*Bot) GetUploadMessagesPhotoServer

func (bot *Bot) GetUploadMessagesPhotoServer(property any) responses.UploadMessagesPhotoServer

func (*Bot) GetUser

func (bot *Bot) GetUser(properties ...any) (user responses.User)

func (*Bot) GetUserLongPollServer

func (bot *Bot) GetUserLongPollServer(properties ...any) responses.LongPollServer

func (*Bot) GetUsers

func (bot *Bot) GetUsers(properties ...any) ([]responses.User, *responses.Error)

func (*Bot) Groups

func (bot *Bot) Groups(properties ...any) (groups []responses.Group, err *responses.Error)

func (*Bot) KickUser

func (bot *Bot) KickUser(properties ...any) (ok bool, err *responses.Error)

func (*Bot) PinMessage

func (bot *Bot) PinMessage(properties ...any) responses.PinMessage

func (*Bot) ResolveDomain

func (bot *Bot) ResolveDomain(properties ...any) (typ string, objectID int, err *responses.Error)

func (*Bot) SaveUploadMessagesDocument

func (bot *Bot) SaveUploadMessagesDocument(file string) (typ string, document responses.SaveUploadMessageDocument, err *responses.Error)

func (*Bot) SaveUploadMessagesPhoto

func (bot *Bot) SaveUploadMessagesPhoto(server int, photo, hash string) (photos []responses.SaveUploadMessagesPhoto, err *responses.Error)

func (*Bot) SendAnswerEvent

func (bot *Bot) SendAnswerEvent(properties ...any) (ok bool, err *responses.Error)

func (*Bot) SendMessage

func (bot *Bot) SendMessage(properties ...any) (message responses.SendMessage)

func (*Bot) SendMessages

func (bot *Bot) SendMessages(properties ...any) (messages []responses.SendMessage, err *responses.Error)

func (*Bot) SendSticker

func (bot *Bot) SendSticker(chatID, stickerID int, properties ...any) (message responses.SendMessage)

func (*Bot) SendStickers

func (bot *Bot) SendStickers(chatID, stickerID int, properties ...any) ([]responses.SendMessage, *responses.Error)

func (*Bot) SetGroupLongPollSettings

func (bot *Bot) SetGroupLongPollSettings(properties ...any) (ok bool, err *responses.Error)

func (*Bot) SetGroupOffline

func (bot *Bot) SetGroupOffline(properties ...any) (ok bool, err *responses.Error)

func (*Bot) SetGroupOnline

func (bot *Bot) SetGroupOnline(properties ...any) (ok bool, err *responses.Error)

func (*Bot) SetJSON

func (bot *Bot) SetJSON() string

func (*Bot) SetMessagePack

func (bot *Bot) SetMessagePack() string

func (*Bot) SetOffline

func (bot *Bot) SetOffline() (ok bool, err *responses.Error)

func (*Bot) SetOnline

func (bot *Bot) SetOnline(properties ...any) (ok bool, err *responses.Error)

func (*Bot) SetStatus

func (bot *Bot) SetStatus(properties ...any) (ok bool, err *responses.Error)

func (*Bot) SetStorage

func (bot *Bot) SetStorage(properties ...any) (result any, err *responses.Error)

func (*Bot) Spam

func (bot *Bot) Spam(properties ...any) (message responses.DeleteMessage, err *responses.Error)

func (*Bot) Spams

func (bot *Bot) Spams(properties ...any) (messages []responses.DeleteMessage, err *responses.Error)

func (*Bot) Unban

func (bot *Bot) Unban(objectID int) (ok bool, err *responses.Error)

func (*Bot) UnbanUser

func (bot *Bot) UnbanUser(properties ...any) (ok bool, err *responses.Error)

func (*Bot) UpdateWidgets

func (bot *Bot) UpdateWidgets(properties ...any) (ok bool, err *responses.Error)

func (*Bot) UploadFile

func (bot *Bot) UploadFile(serverURL, fileURL, field, name string) (uploadedFile UploadFile, err error)

func (*Bot) UploadMessagesDocument

func (bot *Bot) UploadMessagesDocument(chatID int, fileURL, extension string) (typ string, document responses.SaveUploadMessageDocument, err *responses.Error)

func (*Bot) UploadMessagesPhoto

func (bot *Bot) UploadMessagesPhoto(chatID int, fileURL string) (photos []responses.SaveUploadMessagesPhoto, err *responses.Error)

type Deprecated

type Deprecated struct {
	Bot *Bot
}

type UploadFile

type UploadFile []byte

func (UploadFile) JSON

func (file UploadFile) JSON(data any) error

Jump to

Keyboard shortcuts

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