Module: Discordrb::ServerAttributes

Included in:
Light::UltraLightServer, Server
Defined in:
lib/discordrb/data.rb

Overview

Basic attributes a server should have

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#icon_idString (readonly)

Returns the hexadecimal ID used to identify this server's icon.

Returns:

  • (String)

    the hexadecimal ID used to identify this server's icon.


2481
2482
2483
# File 'lib/discordrb/data.rb', line 2481

def icon_id
  @icon_id
end

#nameString (readonly)

Returns this server's name.

Returns:

  • (String)

    this server's name.


2478
2479
2480
# File 'lib/discordrb/data.rb', line 2478

def name
  @name
end

Instance Method Details

#icon_urlString

Utility function to get the URL for the icon image

Returns:

  • (String)

    the URL to the icon image


2485
2486
2487
2488
# File 'lib/discordrb/data.rb', line 2485

def icon_url
  return nil unless @icon_id
  API.icon_url(@id, @icon_id)
end