Class: DBio

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

Overview

All DBio functionality, whether extended or just here.

Defined Under Namespace

Classes: DiscordConnection, DiscordProfile, SearchResult, User, UserConnection

Instance Method Summary collapse

Constructor Details

#initializeDBio

Initialize the API. Not much here really.


8
# File 'lib/dbio.rb', line 8

def initialize; end

Instance Method Details

#top_upvotedObject


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

def top_upvoted

end

#user(id) ⇒ User

Load a user

Parameters:

  • id (Integer, String)

    the user ID or name of the requested user.

Returns:

  • (User)

    the new user object

Raises:

  • (RestClient::NotFound)

    if the specified user does not exist


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

def user(id)
  user = JSON.parse(RestClient.get("https://api.discord.bio/v1/user/details/#{id}"))

  User.new(user['payload'])
end