Fix randomquote bot command
This commit is contained in:
parent
b857b21a2a
commit
8d3b0036d0
@ -66,7 +66,10 @@ func OnMessageCreate(s *discordgo.Session, msg *discordgo.MessageCreate) {
|
|||||||
|
|
||||||
// Random quote
|
// Random quote
|
||||||
if msg.Content == "!randomquote" {
|
if msg.Content == "!randomquote" {
|
||||||
allQuotes := arn.AllQuotes()
|
allQuotes := arn.FilterQuotes(func(quote *arn.Quote) bool {
|
||||||
|
return !quote.IsDraft && quote.IsValid()
|
||||||
|
})
|
||||||
|
|
||||||
quote := allQuotes[rand.Intn(len(allQuotes))]
|
quote := allQuotes[rand.Intn(len(allQuotes))]
|
||||||
s.ChannelMessageSend(msg.ChannelID, "https://notify.moe"+quote.Link())
|
s.ChannelMessageSend(msg.ChannelID, "https://notify.moe"+quote.Link())
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user