mirror-nourybot/pkg/commands/randomquote.go

22 lines
430 B
Go
Raw Normal View History

2021-10-22 17:01:36 +02:00
package commands
import (
"fmt"
"github.com/lyx0/nourybot/cmd/bot"
"github.com/lyx0/nourybot/pkg/api/ivr"
)
2021-10-31 14:57:21 +01:00
// RandomQuote calls the RandomQuote api and responds with a link for a
// random quote image.
2021-10-24 17:52:24 +02:00
func RandomQuote(channel, target, username string, nb *bot.Bot) {
2021-10-22 17:01:36 +02:00
ivrResponse, err := ivr.RandomQuote(target, username)
if err != nil {
nb.Send(channel, fmt.Sprint(err))
return
}
nb.Send(channel, ivrResponse)
}