Documentation ¶
Index ¶
- Constants
- func BooleanToInteger(property bool) int
- func Random() int
- type BanUser
- type Banned
- type BannedUsers
- type Bot
- func (bot *Bot) AnswerEvent(properties ...any) types.SendEventMessage
- func (bot *Bot) Ban(property any) (banned types.Ban)
- func (bot *Bot) BanUser(properties ...any) (banned types.Ban)
- func (bot *Bot) Banned(properties ...any) types.Banned
- func (bot *Bot) BannedUsers(properties ...any) types.BannedUsers
- func (bot *Bot) CallString(method string, query url.Values, data any) error
- func (bot *Bot) Chat(properties ...any) types.Chat
- func (bot *Bot) ChatLink(properties ...any) types.ChatLink
- func (bot *Bot) ChatMembers(properties ...any) types.ChatMembers
- func (bot *Bot) Chats(properties ...any) types.Chats
- func (bot *Bot) Counters(properties ...any) types.Counters
- func (bot *Bot) CreateChat(properties ...any) types.CreateChat
- func (bot *Bot) DeleteMessage(properties ...any) types.DeleteMessage
- func (bot *Bot) DeleteMessages(properties ...any) (destroyed types.DeleteMessages)
- func (bot *Bot) DisableOnline(properties ...any) (offline types.OnlineStatus)
- func (bot *Bot) EditMessage(properties ...any) (edited types.EditMessage)
- func (bot *Bot) EnableOnline(properties ...any) (online types.OnlineStatus)
- func (bot *Bot) Execute(properties ...any) (executed types.Execute)
- func (bot *Bot) Gifts(properties ...any) types.Gifts
- func (bot *Bot) Group(properties ...any) types.Group
- func (bot *Bot) GroupLongPoll(properties ...any) types.LongPoll
- func (bot *Bot) Groups(properties ...any) types.Groups
- func (bot *Bot) Health() types.Health
- func (bot *Bot) HistoryMessages(properties ...any) types.HistoryMessages
- func (bot *Bot) Info(properties ...any) types.Info
- func (bot *Bot) Message(properties ...any) update.Message
- func (bot *Bot) Messages(properties ...any) types.Messages
- func (bot *Bot) Offers(properties ...any) types.Offers
- func (bot *Bot) PinMessage(properties ...any) types.PinMessage
- func (bot *Bot) ResolveDomain(properties ...any) types.ResolveDomain
- func (bot *Bot) SaveUploadMessagesDocument(file string) types.SaveUploadMessagesDocument
- func (bot *Bot) SaveUploadMessagesPhoto(server int, photo, hash string) types.SaveUploadMessagesPhotos
- func (bot *Bot) SendAnswerEvent(properties ...any) (sent types.SendEventMessage)
- func (bot *Bot) SendMessage(properties ...any) types.SendMessage
- func (bot *Bot) SendMessages(properties ...any) (sent types.SendMessages)
- func (bot *Bot) SendSticker(chatID, stickerID int, properties ...any) types.SendMessage
- func (bot *Bot) SendStickers(chatID, stickerID int, properties ...any) types.SendMessages
- func (bot *Bot) SetGroupLongPoll(properties ...any) (server types.SetLongPoll)
- func (bot *Bot) SetOffline() (offline types.OnlineStatus)
- func (bot *Bot) SetOnline(properties ...any) (online types.OnlineStatus)
- func (bot *Bot) SetStatus(properties ...any) (status types.SetStatus)
- func (bot *Bot) SetStorage(properties ...any) types.SetStorage
- func (bot *Bot) Spam(properties ...any) types.DeleteMessage
- func (bot *Bot) Spams(properties ...any) types.DeleteMessages
- func (bot *Bot) Status(properties ...any) types.Status
- func (bot *Bot) Storage(properties ...any) types.Storage
- func (bot *Bot) StorageKeys(properties ...any) types.StorageKeys
- func (bot *Bot) Unban(property any) (unbanned types.Ban)
- func (bot *Bot) UnbanUser(properties ...any) (unbanned types.Ban)
- func (bot *Bot) UpdateWidgets(properties ...any) types.UpdateWidgets
- func (bot *Bot) UploadFile(uploadURL, fileURL, field, name string) (UploadFile, error)
- func (bot *Bot) UploadMessagesDocument(chatID int, fileURL, extension string, properties ...any) types.SaveUploadMessagesDocument
- func (bot *Bot) UploadMessagesDocumentServer(properties ...any) types.UploadMessagesDocumentServer
- func (bot *Bot) UploadMessagesPhoto(chatID int, fileURL string) types.SaveUploadMessagesPhotos
- func (bot *Bot) UploadMessagesPhotoServer(property any) types.UploadMessagesPhoto
- func (bot *Bot) User(properties ...any) types.User
- func (bot *Bot) UserLongPoll(properties ...any) types.LongPoll
- func (bot *Bot) Users(properties ...any) types.Users
- type Chat
- type ChatLink
- type ChatMembers
- type CommentBanUser
- type CreateChat
- type DeleteMessage
- type Deprecated
- type Dialogs
- type EditMessage
- type EnableOnline
- type EventAction
- type Execute
- type Forward
- type Gifts
- type Group
- type GroupLongPoll
- type Groups
- type HistoryMessages
- type Info
- type Message
- type Messages
- type Offers
- type PinMessage
- type ResolveDomain
- type SendEventMessage
- type SendMessage
- type SetGroupLongPoll
- type SetOnline
- type SetStatus
- type SetStorage
- type Status
- type Storage
- type UnbanUser
- type UploadFile
- type UploadMessagesDocumentServer
- type UploadMessagesPhotoServer
- type User
- type UserLongPoll
- type Users
Constants ¶
const ( COMMUNITY_RPS_LIMIT = 20 USER_RPS_LIMIT = 3 )
Variables ¶
This section is empty.
Functions ¶
func BooleanToInteger ¶
Types ¶
type BanUser ¶
type BanUser struct { GroupID int UserID int Time int Reason int Comment CommentBanUser }
type BannedUsers ¶
type Bot ¶
type Bot struct { ID int `json:"id"` Token string `json:"token"` Version float32 `json:"version"` IsGroup bool `json:"is_group"` Deprecated Deprecated MessagePack bool *bots.Config // 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 logrus library. Used during development to detect problems during operation 👆 MessagePack 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 Create ¶
Create 📺 your own bot or add an existing one 🏙️ Accepts arguments: 🎮 String - token 💬 Float32 - version 🌀 Int - community or user page ID 💗 Pointer or no pointer Bot{} structure 🍭 Pointer or no pointer logrus.Logger{} structure 🍻 Returns a pointer to the Bot structure
func (*Bot) AnswerEvent ¶
func (bot *Bot) AnswerEvent(properties ...any) types.SendEventMessage
func (*Bot) BannedUsers ¶
func (bot *Bot) BannedUsers(properties ...any) types.BannedUsers
func (*Bot) CallString ¶
CallString 🔥🌅 sends a request to the VKontakte server 🌌❄ 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) ChatMembers ¶
func (bot *Bot) ChatMembers(properties ...any) types.ChatMembers
func (*Bot) Chats ¶
Chats gets a list of conversationsByID Possible method arguments: GetChat, developer-created methods whose names correspond to the fields of the GetChat structure, int, []int, []string or bool The integer argument specifies either a chatID, if one is missing, or a groupID An array of integer values specifies a list of all requested chats An array of strings specifies a list of additional user and community fields The Boolean type defines the extended answer, which will contain the Users and Groups field Returns the ResponseChats structure with the fields Count, Error, Chats, Users, Groups
func (*Bot) CreateChat ¶
func (bot *Bot) CreateChat(properties ...any) types.CreateChat
func (*Bot) DeleteMessage ¶
func (bot *Bot) DeleteMessage(properties ...any) types.DeleteMessage
func (*Bot) DeleteMessages ¶
func (bot *Bot) DeleteMessages(properties ...any) (destroyed types.DeleteMessages)
func (*Bot) DisableOnline ¶
func (bot *Bot) DisableOnline(properties ...any) (offline types.OnlineStatus)
func (*Bot) EditMessage ¶
func (bot *Bot) EditMessage(properties ...any) (edited types.EditMessage)
func (*Bot) EnableOnline ¶
func (bot *Bot) EnableOnline(properties ...any) (online types.OnlineStatus)
func (*Bot) HistoryMessages ¶
func (bot *Bot) HistoryMessages(properties ...any) types.HistoryMessages
func (*Bot) PinMessage ¶
func (bot *Bot) PinMessage(properties ...any) types.PinMessage
func (*Bot) ResolveDomain ¶
func (bot *Bot) ResolveDomain(properties ...any) types.ResolveDomain
func (*Bot) SaveUploadMessagesDocument ¶
func (bot *Bot) SaveUploadMessagesDocument(file string) types.SaveUploadMessagesDocument
func (*Bot) SaveUploadMessagesPhoto ¶
func (bot *Bot) SaveUploadMessagesPhoto(server int, photo, hash string) types.SaveUploadMessagesPhotos
func (*Bot) SendAnswerEvent ¶
func (bot *Bot) SendAnswerEvent(properties ...any) (sent types.SendEventMessage)
func (*Bot) SendMessage ¶
func (bot *Bot) SendMessage(properties ...any) types.SendMessage
func (*Bot) SendMessages ¶
func (bot *Bot) SendMessages(properties ...any) (sent types.SendMessages)
func (*Bot) SendSticker ¶
func (bot *Bot) SendSticker(chatID, stickerID int, properties ...any) types.SendMessage
func (*Bot) SendStickers ¶
func (bot *Bot) SendStickers(chatID, stickerID int, properties ...any) types.SendMessages
func (*Bot) SetGroupLongPoll ¶
func (bot *Bot) SetGroupLongPoll(properties ...any) (server types.SetLongPoll)
func (*Bot) SetOffline ¶
func (bot *Bot) SetOffline() (offline types.OnlineStatus)
func (*Bot) SetStorage ¶
func (bot *Bot) SetStorage(properties ...any) types.SetStorage
func (*Bot) StorageKeys ¶
func (bot *Bot) StorageKeys(properties ...any) types.StorageKeys
func (*Bot) UpdateWidgets ¶
func (bot *Bot) UpdateWidgets(properties ...any) types.UpdateWidgets
func (*Bot) UploadFile ¶
func (bot *Bot) UploadFile(uploadURL, fileURL, field, name string) (UploadFile, error)
func (*Bot) UploadMessagesDocument ¶
func (*Bot) UploadMessagesDocumentServer ¶
func (bot *Bot) UploadMessagesDocumentServer(properties ...any) types.UploadMessagesDocumentServer
func (*Bot) UploadMessagesPhoto ¶
func (bot *Bot) UploadMessagesPhoto(chatID int, fileURL string) types.SaveUploadMessagesPhotos
func (*Bot) UploadMessagesPhotoServer ¶
func (bot *Bot) UploadMessagesPhotoServer(property any) types.UploadMessagesPhoto
type ChatMembers ¶
type CommentBanUser ¶
type CreateChat ¶
type DeleteMessage ¶
type Deprecated ¶
type Deprecated struct {
Bot *Bot
}
type EditMessage ¶
type EnableOnline ¶
type EnableOnline struct {
GroupID int
}
type EventAction ¶
type EventAction struct { Type string `json:"type,omitempty"` Text string `json:"text,omitempty"` // show_snackbar Link string `json:"link,omitempty"` // open_link // open_app AppID int `json:"app_id,omitempty"` ApplicationID int `json:"-"` OwnerID int `json:"owner_id,omitempty"` Hash string `json:"hash,omitempty"` }
func (EventAction) JSON ¶
func (action EventAction) JSON() string
type Forward ¶
type Forward struct { ChatID int `json:"peer_id"` ChatMessageID int `json:"conversation_message_ids"` IsReply bool `json:"is_reply"` }
func GetForward ¶
type GroupLongPoll ¶
type GroupLongPoll struct {
GroupID int
}
type HistoryMessages ¶
type PinMessage ¶
type ResolveDomain ¶
type ResolveDomain struct {
Domain string
}
type SendEventMessage ¶
type SendMessage ¶
type SendMessage struct { GroupID int RandomID int Domain string ChatID int ChatsID []int UserID int UsersID []int Text string Attachment string Attachments []string StickerID int Payload string Forward Forward Template string Keyboard string DontParseLinks bool DisableMentions bool Latitude string Longitude string Intent string SubscribeID int ExpireTime int }
type SetGroupLongPoll ¶
type SetGroupLongPoll struct { GroupID int Enabled bool Version float32 Message bool ReplyMessage bool EditMessage bool EnableMessage bool DisableMessage bool Typing bool Callback bool Photo bool PhotoComment bool EditPhotoComment bool DeletePhotoComment bool RestorePhotoComment bool Audio bool Video bool VideoComment bool EditVideoComment bool DeleteVideoComment bool RestoreVideoComment bool Post bool Repost bool ReplyPost bool EditReplyPost bool DeleteReplyPost bool RestoreReplyPost bool BlockUser bool UnblockUser bool Like bool Unlike bool BoardPost bool EditBoardPost bool DeleteBoardPost bool RestoreBoardPost bool MarketComment bool EditMarketComment bool DeleteMarketComment bool RestoreMarketComment bool JoinGroup bool LeaveGroup bool Vote bool EditOwners bool ChangeGroupSettings bool ChangeGroupPhoto bool Donate bool ProlongedDonate bool ExpiredDonate bool CancelDonate bool ChangeDonatePrice bool WithdrawMoney bool WithdrawMoneyError bool }
type SetStorage ¶
type SetStorage struct{}
type UploadFile ¶
type UploadFile []byte
func (UploadFile) JSON ¶
func (file UploadFile) JSON(data any)
type UploadMessagesPhotoServer ¶
type UploadMessagesPhotoServer struct {
ChatID int
}
type UserLongPoll ¶
Source Files ¶
- API.go
- ban.go
- banUser.go
- chatControl.go
- counters.go
- deleteMessage.go
- deprecatedMessage.go
- editMessage.go
- execute.go
- gifts.go
- group.go
- groupOnline.go
- health.go
- historyMessages.go
- info.go
- longPoll.go
- message.go
- messages.go
- offers.go
- pinMessage.go
- resolveDomain.go
- saveUploadMessagesDocument.go
- saveUploadMessagesPhoto.go
- sendEventMessage.go
- sendMessage.go
- setLongPollSettings.go
- status.go
- storage.go
- uploadFile.go
- uploadMessagesDocument.go
- uploadMessagesDocumentServer.go
- uploadMessagesPhoto.go
- uploadMessagesPhotoServer.go
- user.go
- userOnline.go
- widgets.go