2020-06-09 13:04:44 +00:00
|
|
|
package discord
|
|
|
|
|
|
|
|
import "go.etztech.xyz/inspiro"
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
commands["inspire"] = command{
|
|
|
|
validate: func(cmd commandInit) bool {
|
|
|
|
return true
|
|
|
|
},
|
2020-06-12 05:17:58 +00:00
|
|
|
run: func(cmd commandInit) (string, error) {
|
2020-07-02 20:00:22 +00:00
|
|
|
if !memeRateLimit.Try() {
|
|
|
|
return "Woah, slow down!", nil
|
|
|
|
}
|
|
|
|
|
2020-06-09 13:04:44 +00:00
|
|
|
sendTyping(cmd.session, cmd.message.ChannelID)
|
|
|
|
|
|
|
|
img, err := inspiro.Generate()
|
|
|
|
if err != nil {
|
2020-06-12 05:17:58 +00:00
|
|
|
return "", err
|
2020-06-09 13:04:44 +00:00
|
|
|
}
|
|
|
|
|
2020-06-12 05:17:58 +00:00
|
|
|
return img, nil
|
2020-06-09 13:04:44 +00:00
|
|
|
},
|
|
|
|
help: "Get inspired!",
|
|
|
|
}
|
|
|
|
}
|