statistics

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func LoadComponent(_ *discordgo.Session) error

LoadComponent loads the two registered slash commands

func StatsGet added in v0.1.0

func StatsGet(g *gin.Context)

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.

Jump to

Keyboard shortcuts

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