commands

package
v0.0.0-...-f4d6457 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = map[string]Command{
	"ping": {
		Command: discordgo.ApplicationCommand{
			Name:        "ping",
			Description: "Pong!",
		},
		Handler: Ping,
	},
	"timer": {
		Command: discordgo.ApplicationCommand{
			Name:        "timer",
			Description: "Sets a timer. Tick tock, tick tock...",
			Options: []*discordgo.ApplicationCommandOption{
				{
					Type:        discordgo.ApplicationCommandOptionInteger,
					Name:        "Seconds",
					Description: "How many seconds to set the timer for",
					Required:    true,
				},
			},
		},
		Handler:      AckSourceContinue,
		Continuation: Timer,
	},
}

Functions

func AckContinue

Use these to immediately continue to the task lambda

func Ping

func Timer

func Timer(interaction *discordgo.Interaction) error

Note, this is certainly not a good way to implement a timer it's just a simple example for how continuation works

Types

type Command

type Command struct {
	Command      discordgo.ApplicationCommand
	Handler      HandlerSig
	Continuation ContinuationSig
}

type ContinuationSig

type ContinuationSig = func(*discordgo.Interaction) error

Jump to

Keyboard shortcuts

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