2025-06-04 16:00:53 -04:00
|
|
|
package bolt
|
|
|
|
|
2025-07-08 15:52:25 -04:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
2025-06-04 16:00:53 -04:00
|
|
|
|
2025-06-08 02:26:06 -04:00
|
|
|
// custom Discord commands
|
2025-06-04 16:00:53 -04:00
|
|
|
type Command struct {
|
2025-06-04 18:28:27 -04:00
|
|
|
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
|
2025-06-08 02:26:06 -04:00
|
|
|
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
|
2025-06-08 02:26:06 -04:00
|
|
|
Roles []string //roles that can use command, if none are set anyone can run the command
|
2025-06-04 16:00:53 -04:00
|
|
|
}
|
|
|
|
|
2025-06-08 02:26:06 -04:00
|
|
|
// command payload functions, any strings returned are sent as a response to the command
|
2025-07-08 15:52:25 -04:00
|
|
|
type Payload func(msg Message) error
|