Class: DBio::DiscordProfile

Inherits:
Object
  • Object
show all
Defined in:
lib/dbio/discord_profile.rb

Overview

Find information about a Discord Profile.

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ DiscordProfile

Initialize the profile


4
5
6
# File 'lib/dbio/discord_profile.rb', line 4

def initialize(data)
  @data = data
end

Instance Method Details

#avatar_hashString

Returns the avatar hash of this user.

Returns:

  • (String)

    the avatar hash of this user


20
21
22
# File 'lib/dbio/discord_profile.rb', line 20

def avatar_hash
  @data['avatar_hash']
end

#discriminatorString

Returns this user's discriminator.

Returns:

  • (String)

    this user's discriminator


25
26
27
# File 'lib/dbio/discord_profile.rb', line 25

def discriminator
  @data['discriminator']
end

#distinctString

Returns the user's name+discriminator. Same as it is in discordrb.

Returns:

  • (String)

    the user's name+discriminator. Same as it is in discordrb


35
36
37
# File 'lib/dbio/discord_profile.rb', line 35

def distinct
  "#{username}\##{discriminator}"
end

#idInteger

The id of the user.

Returns:

  • (Integer)

    User ID in integer form.


10
11
12
# File 'lib/dbio/discord_profile.rb', line 10

def id
  @user['id'].to_i
end

#public_flagsInteger

Returns public flags provided via Oauth, not useful on their own.

Returns:

  • (Integer)

    public flags provided via Oauth, not useful on their own.


30
31
32
# File 'lib/dbio/discord_profile.rb', line 30

def public_flags
  @data['public_flags']
end

#usernameString

Returns the username as it appears on Discord.

Returns:

  • (String)

    the username as it appears on Discord


15
16
17
# File 'lib/dbio/discord_profile.rb', line 15

def username
  @data['username']
end