bolt/command.go

18 lines
598 B
Go
Raw Normal View History

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