adding reaction support (#2)
- some rework of structure to allow for more puposeful response usage - react and response now live on the message itself - message structs split into own file - readme updated to use new methods Reviewed-on: #2 Co-authored-by: jake <jake.young.dev@gmail.com> Co-committed-by: jake <jake.young.dev@gmail.com>
This commit is contained in:
16
command.go
16
command.go
@@ -1,6 +1,8 @@
|
||||
package bolt
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// custom Discord commands
|
||||
type Command struct {
|
||||
@@ -12,14 +14,4 @@ type Command struct {
|
||||
}
|
||||
|
||||
// command payload functions, any strings returned are sent as a response to the command
|
||||
type Payload func(msg Message) (string, error)
|
||||
|
||||
// message information passed to payload function
|
||||
type Message struct {
|
||||
Author string //username of message author
|
||||
ID string //discord ID of message author
|
||||
Words []string //words from message split on whitespace
|
||||
Content string //entire message content
|
||||
Channel string //message channel
|
||||
Server string //message guild
|
||||
}
|
||||
type Payload func(msg Message) error
|
||||
|
Reference in New Issue
Block a user