2025-06-04 16:00:53 -04:00
|
|
|
package bolt
|
|
|
|
|
|
2025-07-09 20:11:12 +00:00
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
)
|
2025-06-04 16:00:53 -04:00
|
|
|
|
2026-02-25 13:24:27 -05:00
|
|
|
// Command represents a bolt command in its entirety
|
2025-06-04 16:00:53 -04:00
|
|
|
type Command struct {
|
2026-02-25 13:24:27 -05:00
|
|
|
//the trigger phrase for the command, this field cannot include the command indicator. If the command is .ping
|
|
|
|
|
//Trigger should be "ping"
|
|
|
|
|
Trigger string
|
|
|
|
|
//handler function to run when command is detected
|
|
|
|
|
Payload Payload
|
|
|
|
|
//the amount of time that must pass before a command can be run again
|
|
|
|
|
Timeout time.Duration
|
|
|
|
|
//timestamp of last command run
|
|
|
|
|
lastRun time.Time
|
|
|
|
|
//the roles that are allowed to execute this command, the command author must have at least one of these roles
|
|
|
|
|
//in order to use the command
|
|
|
|
|
Roles []string
|
2025-06-04 16:00:53 -04:00
|
|
|
}
|