Class: DBots::Service::DiscordBotsGG

Inherits:
DBots::Service show all
Defined in:
lib/dbots/lists/discordbotsgg.rb

Overview

Represents the Discord Bots service.

Constant Summary collapse

BASE_URL =
'https://discord.bots.gg/api/v1'.freeze
ALIASES =
['discordbotsgg', 'discord.bots.gg', 'botsgg', 'bots.gg', 'dbots'].freeze

Constants inherited from DBots::Service

AUTH_HEADER

Instance Attribute Summary

Attributes inherited from DBots::Service

#token

Instance Method Summary collapse

Methods inherited from DBots::Service

#initialize, #token?

Constructor Details

This class inherits a constructor from DBots::Service

Instance Method Details

#get_bot(id, sanitied = false) ⇒ RestClient::Response

Gets the bot listed on this service.

Returns:

  • (RestClient::Response)


15
16
17
18
# File 'lib/dbots/lists/discordbotsgg.rb', line 15

def get_bot(id, sanitied = false)
  id = id.respond_to?(:resolve_id) ? id.resolve_id.to_s : id.to_s
  get_authed("/bots/#{id}", { sanitied: sanitied })
end

#get_bots(query = {}) ⇒ RestClient::Response

Gets a list of bots on this service.

Returns:

  • (RestClient::Response)


23
24
25
26
# File 'lib/dbots/lists/discordbotsgg.rb', line 23

def get_bots(query = {})
  id = id.respond_to?(:resolve_id) ? id.resolve_id.to_s : id.to_s
  get_authed("/bots/#{id}", query)
end