misc

package
v0.0.0-...-abf6750 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HelpCommand = core.Command{
	Name:        "ajuda",
	Description: "Pagina de comandos",
	Handler: func(ctx *core.CommandContext) {
		embed := utils.NewEmbed().Color(0x7289da)

		for _, module := range core.Modules {
			if len(module.Commands) == 0 {
				continue
			}

			var fieldDesc string
			for _, cmd := range module.Commands {
				fieldDesc += utils.Fmt("`/%s` - %s\n", cmd.Name, cmd.Description)
			}

			embed.Field(utils.Fmt("%s %s", module.Emote, module.Name), fieldDesc, false)
		}

		ctx.Ephemeral().Reply(embed)
	},
}
View Source
var PingCommand = core.Command{
	Name:        "ping",
	Description: "Mostra uma média da latência do bot para os servidores do Discord",
	Handler: func(ctx *core.CommandContext) {
		latency := ctx.State.Gateway().Latency()
		if latency <= 0 {
			ctx.Reply(emojis.PingPong, "Não há medições de latência suficientes ainda ;(")
			return
		}

		ctx.Reply(emojis.PingPong, "Pong, %dms.", latency.Milliseconds())
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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