class Spreader::Bot
The Bot
class spreads the json parsed hash into different methods
Attributes
Returns raw hash of the parsed json object @return [Hash]
Returns raw hash of the parsed json object @return [Hash]
Public Class Methods
Initializes the Bot
class @param obj [Object]
# File lib/topgg/bot.rb, line 6 def initialize(obj) @obj = obj end
Public Instance Methods
Returns the avatar link of the bot @return [String]
# File lib/topgg/bot.rb, line 82 def avatar "https://cdn.discordapp.com/avatars/#{@obj['id']}/#{@obj['avatar']}.webp?size=1024" end
Returns true/false depending on if the bot is certified or not @return [Boolean]
# File lib/topgg/bot.rb, line 148 def certifiedBot @obj['certifiedBot'].to_str end
Returns the bot client id @return [String]
# File lib/topgg/bot.rb, line 76 def clientid @obj['clientid'].to_str end
Returns the date on which the bot was submitted @return [Date]
# File lib/topgg/bot.rb, line 106 def date Date.parse(@obj['date']) end
Returns the default Avatar of the client @return [String]
# File lib/topgg/bot.rb, line 22 def defAvatar @obj['defAvatar'].to_str end
Returns the bot descriminator @return [String]
# File lib/topgg/bot.rb, line 94 def descriminator @obj['descriminator'].to_str end
Returns the donate bot guild ID @return [String]
# File lib/topgg/bot.rb, line 172 def donatebotguildid @obj['donatebotguildid'].to_str end
Returns error message, if there's an error @return [String]
# File lib/topgg/bot.rb, line 16 def error @obj['error'].to_str end
Returns github repository link, if any @return [String]
# File lib/topgg/bot.rb, line 46 def github @obj['github'].to_str end
Returns configured guilds in which the bot is in @return [String]
# File lib/topgg/bot.rb, line 124 def guilds @obj['guilds'].to_str end
Returns the bot id @return [String]
# File lib/topgg/bot.rb, line 88 def id @obj['id'].to_str end
Returns the invite link of the bot @return [String]
# File lib/topgg/bot.rb, line 28 def invite @obj['invite'].to_str end
Returns the bot library @return [String]
# File lib/topgg/bot.rb, line 70 def lib @obj['lib'].to_str end
Returns the long Description of the bot @return [String]
# File lib/topgg/bot.rb, line 52 def longdesc @obj['longdesc'].to_str end
Returns the monthyPoints of the bot @return [String]
# File lib/topgg/bot.rb, line 136 def monthlyPoints @obj['monthlyPoints'].to_str end
Returns the owner ids @return [Array<String>]
# File lib/topgg/bot.rb, line 154 def owners @obj['owners'].to_str end
Returns the total points of the bot @return [String]
# File lib/topgg/bot.rb, line 142 def points @obj['points'].to_str end
Returns the default prefix of the bot @return [String]
# File lib/topgg/bot.rb, line 64 def prefix @obj['prefix'].to_str end
Returns the server count of the bot @return [Integer]
# File lib/topgg/bot.rb, line 112 def server_count @obj['server_count'].to_i end
Returns the amount of shards @return [String]
# File lib/topgg/bot.rb, line 118 def shard_count @obj['shard_count'].to_str end
Returns the amount of guilds per shard of the bot @return [String]
# File lib/topgg/bot.rb, line 130 def shards @obj['shards'].to_str end
Returns the short description of the bot @return [String]
# File lib/topgg/bot.rb, line 58 def shortdesc @obj['shortdesc'].to_str end
Returns support server link @return [String]
# File lib/topgg/bot.rb, line 40 def support "https://discord.gg/#{@obj['support']}" end
Returns the bot username @return [String]
# File lib/topgg/bot.rb, line 100 def username @obj['username'].to_str end
Returns the bot website, if configured @return [String]
# File lib/topgg/bot.rb, line 34 def website @obj['website'].to_str end