Files
bolt/command.go
jake 01dd3633ef adding Context
- converting messages and methods into one context per event
2026-02-24 18:45:00 -05:00

47 lines
1.3 KiB
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
}
// type adminToolbox struct {
// *bolt
// }
// type AdminToolBox interface {
// Timeout(userId, serverId string, duration time.Time) error
// ClearTimeout(userId, serverId string) error
// Mute(userId, serverId string) error
// Unmute(userId, serverId string) error
// }
// func NewToolbox(b *bolt) AdminToolBox {
// return &adminToolbox{
// bolt: b,
// }
// }
// func (a *adminToolbox) Timeout(userId, serverId string, duration time.Time) error {
// return a.GuildMemberTimeout(serverId, userId, &duration)
// }
// func (a *adminToolbox) ClearTimeout(userId, serverId string) error {
// return a.GuildMemberTimeout(serverId, userId, nil)
// }
// func (a *adminToolbox) Mute(userId, serverId string) error {
// return a.GuildMemberMute(serverId, userId, true)
// }
// func (a *adminToolbox) Unmute(userId, serverId string) error {
// return a.GuildMemberMute(serverId, userId, false)
// }