commands

package
v0.0.0-...-b906e08 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Echo = &router.Route{
	Name:        "echo",
	Description: "Echos a message",
	Handler: func(ctx *router.Context, args []string) error {
		_, err := ctx.ChannelMessageSend(ctx.Message.ChannelID, args[0])
		return err
	},
	Middlewares: []router.Middleware{router.IsAdmin},
}
View Source
var Ping = &router.Route{
	Name:        "ping",
	Description: "Pings the bot. Responds with pong and latency.",
	Handler: func(ctx *router.Context, args []string) error {
		_, err := ctx.ChannelMessageSend(ctx.Message.ChannelID, fmt.Sprintf("Pong %dms!", ctx.HeartbeatLatency()/time.Millisecond))
		return err
	},
}
View Source
var ReactionRole = &router.Route{
	Name:        "reactionrole",
	Aliases:     []string{"rr"},
	Description: "Interacts with reaction roles",
	Handler: func(ctx *router.Context, args []string) error {
		ctx.ChannelMessageSend(ctx.ChannelID, "You need to use this command with arguments.")
		return nil
	},
}
View Source
var Soundboard = &router.Route{
	Name:        "soundboard",
	Aliases:     []string{"sb"},
	Description: "Interacts with the soundboard",
	Handler: func(ctx *router.Context, args []string) error {
		_, err := ctx.ChannelMessageSend(ctx.Message.ChannelID, "Invalid command invoke: You must use a subcommand with this command.")
		return err
	},
	Subroutes: []*router.Route{play},
}

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