mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-06-27 23:49:25 +00:00
Vendor libs
This commit is contained in:
23
vendor/github.com/peterhellberg/giphy/trending.go
generated
vendored
Normal file
23
vendor/github.com/peterhellberg/giphy/trending.go
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
package giphy
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Trending returns a trending response from the Giphy API
|
||||
func (c *Client) Trending(args ...[]string) (Trending, error) {
|
||||
path := fmt.Sprintf("/gifs/trending?limit=%v", c.Limit)
|
||||
req, err := c.NewRequest(path)
|
||||
if err != nil {
|
||||
return Trending{}, err
|
||||
}
|
||||
|
||||
var res Trending
|
||||
if _, err = c.Do(req, &res); err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
if len(res.Data) == 0 {
|
||||
return res, ErrNoTrendingImagesFound
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
Reference in New Issue
Block a user