Module: DList::Helpers

Defined in:
lib/dblista/helpers.rb

Overview

Helper methods

Class Method Summary collapse

Class Method Details

.get_avatar(id, hash, size = 2048) ⇒ Hash

Crafts avatar url from user ID and avatar hash

Parameters:

  • id (Integer)

    user ID

  • hash (String)

    avatar hash

  • size (Integer) (defaults to: 2048)

    avatar width (defaults to 2048)

Returns:

  • (Hash)

    raw data from DList



11
12
13
# File 'lib/dblista/helpers.rb', line 11

def self.get_avatar(id, hash, size = 2048)
  "https://cdn.discordapp.com/avatars/#{id}/#{hash}?size=#{size}"
end