Class: Onlyfans::Resources::Settings::WelcomeMessage

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ WelcomeMessage

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 WelcomeMessage.

Parameters:



101
102
103
# File 'lib/onlyfans/resources/settings/welcome_message.rb', line 101

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(account, request_options: {}) ⇒ Onlyfans::Models::Settings::WelcomeMessageRetrieveResponse

Get the current automatic welcome message template that is sent when someone subscribes.

Parameters:

Returns:

See Also:



19
20
21
22
23
24
25
26
# File 'lib/onlyfans/resources/settings/welcome_message.rb', line 19

def retrieve(, params = {})
  @client.request(
    method: :get,
    path: ["api/%1$s/settings/welcome-message", ],
    model: Onlyfans::Models::Settings::WelcomeMessageRetrieveResponse,
    options: params[:request_options]
  )
end

#toggle(account, enabled:, request_options: {}) ⇒ Onlyfans::Models::Settings::WelcomeMessageToggleResponse

Enable or disable the automatic welcome message that is sent when someone subscribes.

Parameters:

  • account (String)

    The Account ID

  • enabled (Boolean)

    Whether the welcome message should be enabled.

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

Returns:

See Also:



87
88
89
90
91
92
93
94
95
96
# File 'lib/onlyfans/resources/settings/welcome_message.rb', line 87

def toggle(, params)
  parsed, options = Onlyfans::Settings::WelcomeMessageToggleParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["api/%1$s/settings/welcome-message", ],
    body: parsed,
    model: Onlyfans::Models::Settings::WelcomeMessageToggleResponse,
    options: options
  )
end

#update(account, is_forward: nil, locked_text: nil, media_files: nil, previews: nil, price: nil, rf_guest: nil, rf_partner: nil, rf_tag: nil, text: nil, request_options: {}) ⇒ Onlyfans::Models::Settings::WelcomeMessageUpdateResponse

Some parameter documentations has been truncated, see Models::Settings::WelcomeMessageUpdateParams for more details.

Update the automatic welcome message template that is sent when someone subscribes.

**mediaFi

Parameters:

  • account (String)

    The Account ID

  • is_forward (Boolean)
  • locked_text (Boolean)

    Whether the text should be shown or hidden.

  • media_files (Array<Object>)

    Direct file uploads, OFAPI ‘ofapi_media_` IDs, or OF vault IDs. Will be hidden i

  • previews (Array<Object>)

    Direct file uploads, OFAPI ‘ofapi_media_` IDs, OF vault IDs, or integer indices

  • price (Integer)

    Price for paid content (0 or between 3-200). In case this is not zero,

  • rf_guest (String)

    Array of OnlyFans Release Form Guest IDs to tag in your message.

  • rf_partner (String)

    Array of OnlyFans Release Form Partners IDs to tag in your message.

  • rf_tag (String)

    Array of OnlyFans Creator User IDs to tag in your message.

  • text (String)

    The welcome message text content. Required unless a media file is present.

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

Returns:

See Also:



62
63
64
65
66
67
68
69
70
71
# File 'lib/onlyfans/resources/settings/welcome_message.rb', line 62

def update(, params = {})
  parsed, options = Onlyfans::Settings::WelcomeMessageUpdateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["api/%1$s/settings/welcome-message", ],
    body: parsed,
    model: Onlyfans::Models::Settings::WelcomeMessageUpdateResponse,
    options: options
  )
end