bolt/command.go
jake 90a17ded2b adding reaction support (#2)
- 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

Reviewed-on: #2
Co-authored-by: jake <jake.young.dev@gmail.com>
Co-committed-by: jake <jake.young.dev@gmail.com>
2025-07-09 20:11:12 +00: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