class Spreader::Bot

The Bot class spreads the json parsed hash into different methods

Attributes

obj[R]

Returns raw hash of the parsed json object @return [Hash]

raw[R]

Returns raw hash of the parsed json object @return [Hash]

Public Class Methods

new(obj) click to toggle source

Initializes the Bot class @param obj [Object]

# File lib/topgg/bot.rb, line 6
def initialize(obj)
  @obj = obj
end

Public Instance Methods

avatar() click to toggle source

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
bannerUrl() click to toggle source

Returns the bot banner url @return [String]

# File lib/topgg/bot.rb, line 166
def bannerUrl
  @obj['bannerUrl'].to_str
end
certifiedBot() click to toggle source

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
clientid() click to toggle source

Returns the bot client id @return [String]

# File lib/topgg/bot.rb, line 76
def clientid
  @obj['clientid'].to_str
end
date() click to toggle source

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
defAvatar() click to toggle source

Returns the default Avatar of the client @return [String]

# File lib/topgg/bot.rb, line 22
def defAvatar
  @obj['defAvatar'].to_str
end
descriminator() click to toggle source

Returns the bot descriminator @return [String]

# File lib/topgg/bot.rb, line 94
def descriminator
  @obj['descriminator'].to_str
end
donatebotguildid() click to toggle source

Returns the donate bot guild ID @return [String]

# File lib/topgg/bot.rb, line 172
def donatebotguildid
  @obj['donatebotguildid'].to_str
end
error() click to toggle source

Returns error message, if there's an error @return [String]

# File lib/topgg/bot.rb, line 16
def error
  @obj['error'].to_str
end
github() click to toggle source

Returns github repository link, if any @return [String]

# File lib/topgg/bot.rb, line 46
def github
  @obj['github'].to_str
end
guilds() click to toggle source

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
id() click to toggle source

Returns the bot id @return [String]

# File lib/topgg/bot.rb, line 88
def id
  @obj['id'].to_str
end
invite() click to toggle source

Returns the invite link of the bot @return [String]

# File lib/topgg/bot.rb, line 28
def invite
  @obj['invite'].to_str
end
lib() click to toggle source

Returns the bot library @return [String]

# File lib/topgg/bot.rb, line 70
def lib
  @obj['lib'].to_str
end
longdesc() click to toggle source

Returns the long Description of the bot @return [String]

# File lib/topgg/bot.rb, line 52
def longdesc
  @obj['longdesc'].to_str
end
monthlyPoints() click to toggle source

Returns the monthyPoints of the bot @return [String]

# File lib/topgg/bot.rb, line 136
def monthlyPoints
  @obj['monthlyPoints'].to_str
end
owners() click to toggle source

Returns the owner ids @return [Array<String>]

# File lib/topgg/bot.rb, line 154
def owners
  @obj['owners'].to_str
end
points() click to toggle source

Returns the total points of the bot @return [String]

# File lib/topgg/bot.rb, line 142
def points
  @obj['points'].to_str
end
prefix() click to toggle source

Returns the default prefix of the bot @return [String]

# File lib/topgg/bot.rb, line 64
def prefix
  @obj['prefix'].to_str
end
server_count() click to toggle source

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
shard_count() click to toggle source

Returns the amount of shards @return [String]

# File lib/topgg/bot.rb, line 118
def shard_count
  @obj['shard_count'].to_str
end
shards() click to toggle source

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
shortdesc() click to toggle source

Returns the short description of the bot @return [String]

# File lib/topgg/bot.rb, line 58
def shortdesc
  @obj['shortdesc'].to_str
end
support() click to toggle source

Returns support server link @return [String]

# File lib/topgg/bot.rb, line 40
def support
  "https://discord.gg/#{@obj['support']}"
end
tags() click to toggle source

Return the bot tags @return [Array<String>]

# File lib/topgg/bot.rb, line 160
def tags
  @obj['tags'].to_str
end
username() click to toggle source

Returns the bot username @return [String]

# File lib/topgg/bot.rb, line 100
def username
  @obj['username'].to_str
end
website() click to toggle source

Returns the bot website, if configured @return [String]

# File lib/topgg/bot.rb, line 34
def website
  @obj['website'].to_str
end