class DBio

All DBio functionality, whether extended or just here.

Public Class Methods

new() click to toggle source

Initialize the API. Not much here really.

# File lib/dbio.rb, line 8
def initialize; end

Public Instance Methods

top_likes() click to toggle source

Returns the users by most likes. Their data is short, so it's not really worth storing a lot of data @see [SearchResult#user] @return [Array<SearchResult>] the response

# File lib/dbio.rb, line 24
def top_likes
  JSON.parse(RestClient.get("https://api.discord.bio/topLikes"))['payload'].map { |e| SearchResult.new(e) }
end
user(id) click to toggle source

Load a user @param id [Integer, String] the user ID or name of the requested user. @raise [RestClient::NotFound] if the specified user does not exist @return [User] the new user object

# File lib/dbio.rb, line 14
def user(id)
  user = JSON.parse(RestClient.get("https://api.discord.bio/user/details/#{id}"))

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