Files
bolt/command.go

47 lines
1.3 KiB
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
}
// 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)
// }