MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin-Playground / getPicByBreed

Function getPicByBreed

plugin/cybercat/catdata.go:242–252  ·  view source on GitHub ↗
(catBreed string)

Source from the content-addressed store, hash-verified

240}
241
242func getPicByBreed(catBreed string) (url string, err error) {
243 data, err := web.GetData(apiURL + "search?breed_ids=" + catBreed)
244 if err != nil {
245 return
246 }
247 url = gjson.ParseBytes(data).Get("0.url").String()
248 if url == "" {
249 err = errors.New("no image found")
250 }
251 return
252}
253
254func (sql *catdb) insert(gid string, dbInfo *catInfo) error {
255 sql.Lock()

Callers 2

initFunction · 0.85
initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected