Documentation ¶
Index ¶
Constants ¶
const ( FailedRequest = "request failed" InvalidResponse = "invalid response. Response is not JSON-decodable." UnexpectedError = "unexpected error" MissingUsernameParameter = "username GET parameter required" MissingParameters = "bot_id and user_id GET parameters required" BotNotFound = "bot not found" )
The constants below are set to simplify error handling. Please consult the appropriate page on the wiki to learn more about this topic.
Variables ¶
This section is empty.
Functions ¶
func GetUserRatingByBotID ¶
GetUserRatingByBotID returns a boolean telling if the user has voted and an integer expressing the number of stars selected by the user. It might return one of the following errors: FailedRequest, InvalidResponse, UnexpectedError, MissingParameters, BotNotFound
func GetUserRatingByBotUsername ¶
GetUserRatingByBotUsername returns a boolean telling if the user has voted and an integer expressing the number of stars selected by the user. Please note: this method sends two API calls instead of one as GetUserRatingByBotID. If you have to get ratings for one bot only, it's better if you save the ID of the bot somewhere and you use GetUserRatingByBotID. It might return one of the following errors: FailedRequest, InvalidResponse, UnexpectedError, MissingParameters, BotNotFound
Types ¶
type BotInfo ¶
type BotInfo struct { Rating struct { AverageRating float64 TotalStars, VotesCount int } Infos struct { Name, Username, Description string Languages, Tags []string HasPhoto, SupportsGroups, SupportsInline, HasCopyrightAlert bool } ID, DeveloperID int ChannelLink string }
BotInfo contains bot informations. If field ChannelLink is == "", the bot hasn't been published yet. If DeveloperID == 0, the bot wasn't claimed by its developer.
func GetBotInfo ¶
GetBotInfo returns a struct containing informations about a bot present in BotsArchive. It might return one of the following errors: FailedRequest, InvalidResponse, UnexpectedError, MissingUsernameParameter, BotNotFound