canopeas/discord/jupiter.go

24 lines
444 B
Go
Raw Permalink Normal View History

package discord
import "go.etztech.xyz/sedbot/imgur"
func init() {
cmd := command{
validate: func(cmd commandInit) bool {
return true
},
run: func(cmd commandInit) (string, error) {
if !memeRateLimit.Try() {
return "", nil
}
img := imgur.Images[rand.Intn(len(imgur.Images))-1]
return img.Link, nil
},
help: "Get a Jupiter image",
}
commands["jupiter"] = cmd
commands["jup"] = cmd
commands["jupjup"] = cmd
}