Documentation
¶
Index ¶
- Variables
- func Fetch(method string, url string, structure interface{}, body map[string]interface{}) error
- type Bot
- type Client
- func (self Client) AddToken(botlist string, token string)
- func (self Client) GetAllLists() (map[string]List, error)
- func (self Client) GetBot(ID string) (Bot, error)
- func (self Client) GetLegacyIDS() (map[string]string, error)
- func (self Client) GetList(ID string) (List, error)
- func (self Client) PostStats(ID string, stats Stats) (PostResponse, error)
- type List
- type ListFeature
- type PostResponse
- type Stats
Constants ¶
This section is empty.
Variables ¶
View Source
var UnusualResponses []int = []int{400, 401, 404, 429, 500}
All unusual responses from the botblock api!
Functions ¶
Types ¶
type Bot ¶
type Bot struct {
// ID of the discord bot
ID string `json:"id"`
// Username of the discord bot
Username string `json:"username"`
// Discriminator of the discord bot
Discriminator string `json:"discriminator"`
// Array of owner's discord id
Owners []string `json:"owners"`
// Server count of the bot
ServerCount int64 `json:"server_count"`
// Invite url of the bot
Invite string `json:"invite"`
// Prefix of the discord bot
Prefix string `json:"prefix"`
// Website url of the bot
Website string `json:"website"`
// Support server invite of the bot
Support string `json:"support"`
// Github repo url of the bot
Github string `json:"github"`
// The library which was used to make the bot
Library string `json:"library"`
// A map with the key as botlist id and the value as the data sent by each botlist!
ListData map[string][]interface{} `json:"list_data"`
}
Botblock api's bot struct
type Client ¶
Botblock api Client structure
func (Client) AddToken ¶
Add a paticular auth token for a paticular botlist after declaring client! The id paramater should be the botlist id and token should be the token of the botlist
func (Client) GetAllLists ¶
Returns a map with botlist id as string and value as list containg all lists registered in botblock!
func (Client) GetLegacyIDS ¶
Returns a map with the keys as old botlist if and values with the new one from the botblock api!
type List ¶
type List struct {
// ID of the discord bot list
ID string `json:"id"`
// Timestamp when the botlist was added
AddedAt int64 `json:"added"`
// Name of the list
Name string `json:"name"`
// Web url of the list
URL string `json:"url"`
// Icon url of the list
Icon string `json:"icon"`
// Language which the list uses to communicate
Language string `json:"language"`
// Number stating is the list displayed in botblock or not (0 = hidden)
Display int `json:"display"`
// Number stating is the list defunct or not (0 = list active)
Defunct int `json:"defunct"`
// Boolean stating is the list discord related only or not
DiscordOnly int `json:"discord_only"`
// Description of the list
Description string `json:"description"`
// Api documentation url of the list
ApiDocs string `json:"api_docs"`
// Api url of the list where you can post stats
ApiPost string `json:"api_post"`
// Api field of the object returned by the list's api which contains the data
ApiField string `json:"api_field"`
// List's api shard id
ApiShardID string `json:"api_shard_id"`
// List's api shard count
ApiShardCount string `json:"api_shard_count"`
// List's api shards
ApiShards string `json:"api_shards"`
// List's web api url where you can get bot details
ApiGet string `json:"api_get"`
// List's web api url where you can get all the bots
ApiAll string `json:"api_all"`
// List's web url where you can view bot's details
ViewBot string `json:"view_bot"`
// List's bot widget api url
BotWidget string `json:"bot_widget"`
// Content of the botlist
Content string `json:"content"`
// Owners of the list
Owners string `json:"owners"`
// Discord invite of the list
Discord string `json:"discord"`
// Array of features of the list
Features []ListFeature `json:"features"`
}
Botblock api's botlist structure
type ListFeature ¶
type ListFeature struct {
// Name of the feature
Name string `json:"name"`
// Id of the feature
ID int64 `json:"id"`
// Order index of the features
Display int64 `json:"display"`
// Types of feature (0 = positive, 1 = neutral, 2 = bad
Type int64 `json:"type"`
// Description of the feature
Description string `json:"description"`
// Number stating is the list known to have this feature (0 = false, 1 = true)
Value int64 `json:"value"`
}
Feature structure of the list
type PostResponse ¶
type PostResponse struct {
// A map with keys of botlist id which have successfully updated stats and the value is an array with the first item in the array is the HTTP status code of the response, the second is the string response body and the third item is the body data sent to the list.
Success map[string][]interface{} `json:"success"`
// A map with keys of botlist id which have failed updating stats and the value is an array with the first item in the array is the HTTP status code of the response, the second is the string response body and the third item is the body data sent to the list.
Failure map[string][]interface{} `json:"failure"`
}
Response snet by the post method of botblock api
Click to show internal directories.
Click to hide internal directories.