[chore] cleaning
- removing old or commented code - removing unused or deprecated types - commenting everything, probably too much - split msgEventHandler logic into methods - readme update, removed most docs the pkg site looks good - adjusted intents option, no need for a type
This commit is contained in:
51
command.go
51
command.go
@@ -4,43 +4,18 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// custom Discord commands
|
||||
// Command represents a bolt command in its entirety
|
||||
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
|
||||
//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
|
||||
}
|
||||
|
||||
// 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)
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user