Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var C = api.Component{ Code: "statistics", Name: "Statistics", Description: "This Component returns statistics about the bot and the runtime.", State: &api.State{ DefaultEnabled: true, }, }
C is the instance of the statistics component
Functions ¶
func LoadComponent ¶
LoadComponent loads the two registered slash commands
func StatsGet ¶ added in v0.1.0
StatsGet endpoint
@Summary Get general statistics about the bot @Description This endpoint collects publicly available statistics and returns them. @Description The result contains general information like the current count of guilds or version. @Description Note that some statistics might be cached and only updated every few minutes. @Tags General @Produce json @Success 200 {object} StatsDTO "The statistics collected by the bot" @Failure 500 {object} webapi.ErrorResponse "An error indicating that an internal error happened" @Router /stats [get]
Types ¶
type StatsDTO ¶ added in v0.1.0
type StatsDTO struct { GuildCount int `json:"guild_count"` SlashCommandCount int `json:"slash_command_count"` Version string `json:"version"` } //@Name Statistics
StatsDTO is a DTO used to store statistics that can be output in the web api.
@Description Statistics holds statistics about the bot like the current version.