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: "boobs", Usage: "", Description: "Sends some titties", } 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 }