class ListCordRB::Bot

Find information about bots.

Attributes

data[R]

@return data in raw json form.

to_s[R]

@return data in raw json form.

Public Class Methods

new(id) click to toggle source

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

avatar() click to toggle source

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

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

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
clientid()
Alias for: id
description() click to toggle source

The description of the bot. @return [String] the bot's Description.

# File lib/listcordrb/bot.rb, line 41
def description
  @data['description']
end
discrim()
Alias for: discriminator
discriminator() click to toggle source

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
Also aliased as: discrim, tag
distinct() click to toggle source

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

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

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
guild()
Alias for: servers
guilds()
Alias for: servers
id() click to toggle source

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
Also aliased as: clientid
invite() click to toggle source

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

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
online()
Alias for: online?
online?() click to toggle source

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
Also aliased as: online
owners() click to toggle source

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

Get the bot's prefix @return [Integer] the bot's prefix.

# File lib/listcordrb/bot.rb, line 110
def prefix
  @data['prefix']
end
premium()
Alias for: premium?
premium?() click to toggle source

The premium status of the bot. @return [true, false] the bot's premium status.

# File lib/listcordrb/bot.rb, line 134
def premium?
  @data['premium']
end
Also aliased as: premium
server()
Alias for: servers
servers() click to toggle source

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
Also aliased as: guilds, guild, server
support() click to toggle source

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
tag()
Alias for: discriminator
username() click to toggle source

The username of the bot. @return [String] the bot's username.

# File lib/listcordrb/bot.rb, line 76
def username
  @data['username']
end
verified?() click to toggle source

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

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

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