mostly nsfw owner stuff and kvstore persistence.
This commit is contained in:
33
cmd/boobs.go
Normal file
33
cmd/boobs.go
Normal file
@ -0,0 +1,33 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user