mirror of https://github.com/velour/catbase.git
giph: add not found message
This commit is contained in:
parent
5a7544d828
commit
67c88190ab
|
@ -40,6 +40,11 @@ func (p *GiphyPlugin) register() {
|
|||
HelpText: "search for a giph",
|
||||
Handler: func(r bot.Request) bool {
|
||||
u, w, h := p.query(r.Values["search"])
|
||||
if u == "" {
|
||||
msg := fmt.Sprintf("Hey %v, I couldn't download that image you asked for.", r.Msg.User.Name)
|
||||
p.b.Send(r.Conn, bot.Ephemeral, r.Msg.Channel, r.Msg.User.ID, msg)
|
||||
return true
|
||||
}
|
||||
p.b.Send(r.Conn, bot.Message, r.Msg.Channel, "", bot.ImageAttachment{
|
||||
URL: u,
|
||||
AltTxt: fmt.Sprintf("%s: %s\nPowered by Giphy", r.Msg.User.Name, r.Values["search"]),
|
||||
|
|
Loading…
Reference in New Issue