2020-07-02 21:52:20 +00:00
|
|
|
package discord
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2021-02-23 05:53:55 +00:00
|
|
|
commands = append(commands, &command{
|
|
|
|
name: "compliment",
|
2020-07-02 21:52:20 +00:00
|
|
|
validate: func(cmd commandInit) bool {
|
|
|
|
return true
|
|
|
|
},
|
|
|
|
run: func(cmd commandInit) (string, error) {
|
|
|
|
if !memeRateLimit.Try() {
|
|
|
|
return "", nil
|
|
|
|
}
|
|
|
|
|
|
|
|
fields := strings.Fields(cmd.message.Content)
|
|
|
|
|
|
|
|
var target string
|
|
|
|
if len(fields) > 1 {
|
|
|
|
target = strings.Join(fields[1:], " ")
|
|
|
|
} else if cmd.message.Member.Nick != "" {
|
|
|
|
target = cmd.message.Member.Nick
|
|
|
|
} else {
|
|
|
|
target = cmd.message.Author.Username
|
|
|
|
}
|
|
|
|
|
|
|
|
compliment := fmt.Sprintf("%s, I would %s my %s just to %s.",
|
|
|
|
target,
|
|
|
|
random(cmd.config.Compliment.Verbs),
|
|
|
|
random(cmd.config.Compliment.Nouns),
|
|
|
|
random(cmd.config.Compliment.MinorThings),
|
|
|
|
)
|
|
|
|
|
|
|
|
sendMessage(cmd.session, cmd.message.ChannelID, compliment, true)
|
|
|
|
|
|
|
|
return "", nil
|
|
|
|
},
|
|
|
|
help: "Compliment someone!",
|
2021-02-23 05:53:55 +00:00
|
|
|
})
|
2020-07-02 21:52:20 +00:00
|
|
|
}
|