You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
768 B
33 lines
768 B
package cmd |
|
|
|
import ( |
|
"os" |
|
|
|
"github.com/kf5grd/keybasebot" |
|
"github.com/teris-io/shortid" |
|
"samhofi.us/x/keybase/v2/types/chat1" |
|
) |
|
|
|
/*var BoobsAd = chat1.UserBotCommandInput{ |
|
Name: "eyebleach", |
|
Usage: "", |
|
Description: "Sends some cute critters", |
|
}*/ |
|
|
|
func Boobs(m chat1.MsgSummary, b *keybasebot.Bot) (bool, error) { |
|
path, desc, err := getRandomRedditMedia(b, "boobs", "top", 100) |
|
if err != nil { |
|
eid := shortid.MustGenerate() |
|
b.Logger.Error("%s: %+v", eid, err) |
|
b.KB.ReactByConvID(m.ConvID, m.Id, "Error: %s", eid) |
|
return true, nil |
|
} |
|
// upload the image |
|
b.KB.UploadToConversation(m.ConvID, desc, path) |
|
// delete the file |
|
err = os.Remove(path) |
|
if err != nil { |
|
b.Logger.Error("Unable to remove file %s", path) |
|
} |
|
return true, nil |
|
}
|
|
|