bolt/command.go
jake 286294bab9
adding reaction support
- some rework of structure to allow for more puposeful response usage
- react and response now live on the message itself
- message structs split into own file
- readme updated to use new methods
2025-07-08 15:52:25 -04:00

18 lines
598 B
Go

package bolt
import (
"time"
)
// custom Discord commands
type Command struct {
Trigger string //command that triggers payload NOT including the indicator
Payload Payload //payload function to run when a command is detected
Timeout time.Duration //the amount of time before command can be run again
lastRun time.Time //timestamp of last command run
Roles []string //roles that can use command, if none are set anyone can run the command
}
// command payload functions, any strings returned are sent as a response to the command
type Payload func(msg Message) error