Class: DBio::DiscordProfile
- Inherits:
-
Object
- Object
- DBio::DiscordProfile
- Defined in:
- lib/dbio/discord_profile.rb
Overview
Find information about a Discord Profile.
Instance Method Summary collapse
-
#avatar_hash ⇒ String
The avatar hash of this user.
-
#discriminator ⇒ String
This user's discriminator.
-
#distinct ⇒ String
The user's name+discriminator.
-
#id ⇒ Integer
The id of the user.
-
#initialize(data) ⇒ DiscordProfile
constructor
Initialize the profile.
-
#public_flags ⇒ Integer
Public flags provided via Oauth, not useful on their own.
-
#username ⇒ String
The username as it appears on Discord.
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_hash ⇒ String
Returns the avatar hash of this user.
20 21 22 |
# File 'lib/dbio/discord_profile.rb', line 20 def avatar_hash @data['avatar_hash'] end |
#discriminator ⇒ String
Returns this user's discriminator.
25 26 27 |
# File 'lib/dbio/discord_profile.rb', line 25 def discriminator @data['discriminator'] end |
#distinct ⇒ String
Returns 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 |
#id ⇒ Integer
The id of the user.
10 11 12 |
# File 'lib/dbio/discord_profile.rb', line 10 def id @user['id'].to_i end |
#public_flags ⇒ Integer
Returns 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 |
#username ⇒ String
Returns the username as it appears on Discord.
15 16 17 |
# File 'lib/dbio/discord_profile.rb', line 15 def username @data['username'] end |