class ListCordRB::Bot
Find information about bots.
Attributes
@return data in raw json form.
@return data in raw json form.
Public Class Methods
Initialize the bot @param id [Integer, String] Integer/String ID of bot you're requesting.
# File lib/listcordrb/bot.rb, line 5 def initialize(id) url = "https://listcord.com/api/bot/#{id}" @data = JSON.parse(RestClient.get(url)) end
Public Instance Methods
The avatar hash of the bot's avatar. @return [String] the bot's avatar.
# File lib/listcordrb/bot.rb, line 55 def avatar @data['avatar'] end
Get's the bot's avatar as an img, ready to be used in image linking. @return [String] the bot's avatar image url.
# File lib/listcordrb/bot.rb, line 61 def avatar_img "https://cdn.discordapp.com/avatars/#{id}/#{avatar}.webp?size=1024" end
The certified status of the bot. @return [true, false] the bot's certified status.
# File lib/listcordrb/bot.rb, line 128 def certified? @data['certified'] end
The description of the bot. @return [String] the bot's Description.
# File lib/listcordrb/bot.rb, line 41 def description @data['description'] end
The discriminator of the bot. @return [Integer] the bot's discriminator without the #.
# File lib/listcordrb/bot.rb, line 67 def discriminator @data['discriminator'].to_i end
Returns the bot's distinct, which is the Username and Discriminator. @return [String] the bot's distinct.
# File lib/listcordrb/bot.rb, line 82 def distinct "#{username}\##{tag}" end
Return the error message if there is one, nil otherwise. @return [String, nil] the error message.
# File lib/listcordrb/bot.rb, line 17 def error @data['message'] end
Return true if there is an error, false otherwise. @return [true, false] if there is an error.
# File lib/listcordrb/bot.rb, line 23 def error? !@data['message'].nil? end
Get the bot's ID. @return [Integer] the bot's id.
# File lib/listcordrb/bot.rb, line 47 def id @data['id'].to_i end
The custom bot invite url of the bot. @return [String] the bot's invite link.
# File lib/listcordrb/bot.rb, line 29 def invite @data['invite'] end
The amount of times the invite button has been clicked for the bot. @return [Integer] the amount of times the bot has been invited.
# File lib/listcordrb/bot.rb, line 156 def invites @data['invites'] end
Is the bot online or not?. @return [true, false] the bot's online status.
# File lib/listcordrb/bot.rb, line 148 def online? @data['online'] end
The owners of the bot. First one in the array is the main owner. @return [Array<String>] the bot's owners in an array.
# File lib/listcordrb/bot.rb, line 142 def owners @data['owners'] end
Get the bot's prefix @return [Integer] the bot's prefix.
# File lib/listcordrb/bot.rb, line 110 def prefix @data['prefix'] end
Get the bot's server count @return [Integer] the bot's server count.
# File lib/listcordrb/bot.rb, line 100 def servers @data['servers'].to_i end
The support server invite code of the bot. @return [String] the bot's support server code.
# File lib/listcordrb/bot.rb, line 88 def support @data['support'] end
The bot's support server link, ready for clicking. @return [String] the bot's support server link.
# File lib/listcordrb/bot.rb, line 94 def support_link "https://discord.gg/#{support}" end
The username of the bot. @return [String] the bot's username.
# File lib/listcordrb/bot.rb, line 76 def username @data['username'] end
The verified status of the bot. @return [true, false] the bot's verified status.
# File lib/listcordrb/bot.rb, line 122 def verified? @data['verified'] end
The amount of upvotes the bot has. @return [Integer] the bot's total votes.
# File lib/listcordrb/bot.rb, line 116 def votes @data['votes'].to_i end
The website url of the bot. @return [String] the bot's website link.
# File lib/listcordrb/bot.rb, line 35 def website @data['website'] end