2020-06-09 13:04:44 +00:00
|
|
|
package discord
|
|
|
|
|
|
|
|
import "go.etztech.xyz/inspiro"
|
|
|
|
|
|
|
|
func init() {
|
2021-02-23 05:53:55 +00:00
|
|
|
commands = append(commands, &command{
|
|
|
|
name: "inspire",
|
2020-06-09 13:04:44 +00:00
|
|
|
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() {
|
2020-07-02 21:33:47 +00:00
|
|
|
return "", nil
|
2020-07-02 20:00:22 +00:00
|
|
|
}
|
|
|
|
|
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!",
|
2021-02-23 05:53:55 +00:00
|
|
|
})
|
2020-06-09 13:04:44 +00:00
|
|
|
}
|