[chore] comments and function scope
- methods no longer exported if not used - readme update - comments updated
This commit is contained in:
14
command.go
14
command.go
@@ -2,23 +2,23 @@ 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 run again
|
||||
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
|
||||
Roles []string //roles that can use command, if none are set anyone can run the command
|
||||
}
|
||||
|
||||
// payload function type handling commands. The returned error is parsed and, if no error,
|
||||
// is detected then the response string (res) will be sent in response to the command message
|
||||
// command payload functions, any strings returned are sent as a response to the command
|
||||
type Payload func(msg Message) (string, error)
|
||||
|
||||
// contains the basic information needed for a message command
|
||||
// message information passed to payload function
|
||||
type Message struct {
|
||||
Author string //username of message author
|
||||
Words []string //words from message split on whitespace
|
||||
Content string //entire message content
|
||||
Channel string //channel message was sent in
|
||||
Server string //guild message was sent in
|
||||
Channel string //message channel
|
||||
Server string //message guild
|
||||
}
|
||||
|
Reference in New Issue
Block a user