class Discordrb::Activity::Assets
Assets
for rich presence images and hover text
Attributes
@return [String, nil] the application ID for these assets.
@return [String, nil] the asset ID for the large image of this activity
@return [String, nil] text displayed when hovering over the large iamge
@return [String, nil] the asset ID for the small image of this activity
@return [String, nil]
Public Class Methods
@!visibility private
# File lib/discordrb/data/activity.rb, line 179 def initialize(data, application_id) @application_id = application_id @large_image_id = data['large_image'] @large_text = data['large_text'] @small_image_id = data['small_image'] @small_text = data['small_text'] end
Public Instance Methods
Utility function to get an Asset’s large image URL. @param format [String, nil] If ‘nil`, the URL will default to `webp`. You can otherwise specify one of `webp`, `jpg`, or `png`. @return [String] the URL to the large image asset.
# File lib/discordrb/data/activity.rb, line 190 def large_image_url(format = 'webp') API.asset_url(@application_id, @large_image_id, format) end
Utility function to get an Asset’s large image URL. @param format [String, nil] If ‘nil`, the URL will default to `webp`. You can otherwise specify one of `webp`, `jpg`, or `png`. @return [String] the URL to the small image asset.
# File lib/discordrb/data/activity.rb, line 197 def small_image_url(format = 'webp') API.asset_url(@application_id, @small_image_id, format) end