Class: Onlyfans::Resources::Giphy

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/giphy.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Giphy

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Giphy.

Parameters:



67
68
69
# File 'lib/onlyfans/resources/giphy.rb', line 67

def initialize(client:)
  @client = client
end

Instance Method Details

Get trending GIFs from the OnlyFans Giphy proxy. Use the returned ‘id` as the `giphyId` body param when sending a chat or mass message.

Parameters:

  • account (String)

    The Account ID

  • limit (Integer)

    Number of GIFs to return (default = 10, max = 50)

  • offset (Integer)

    Number of GIFs to skip for pagination (default = 0)

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/onlyfans/resources/giphy.rb', line 22

def list_trending(, params = {})
  parsed, options = Onlyfans::GiphyListTrendingParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/giphy/trending", ],
    query: query,
    model: Onlyfans::Models::GiphyListTrendingResponse,
    options: options
  )
end

#search(account, q:, limit: nil, offset: nil, request_options: {}) ⇒ Onlyfans::Models::GiphySearchResponse

Search GIFs from the OnlyFans Giphy proxy. Use the returned ‘id` as the `giphyId` body param when sending a chat or mass message.

Parameters:

  • account (String)

    The Account ID

  • q (String)

    The search query.

  • limit (Integer)

    Number of GIFs to return (default = 10, max = 50)

  • offset (Integer)

    Number of GIFs to skip for pagination (default = 0)

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/onlyfans/resources/giphy.rb', line 52

def search(, params)
  parsed, options = Onlyfans::GiphySearchParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/giphy/search", ],
    query: query,
    model: Onlyfans::Models::GiphySearchResponse,
    options: options
  )
end