radarcordrb

Radarcordrb is a Ruby package (a.k.a. Gem) that allows you to easily interact with the radarcord.net API with the Ruby programming language.

Features include posting your Discord bot's stats (guilds/shards) and pinging your bot's uptime to radarcord.

Setup

You can install radarcordrb through the following methods:

Method 1: Install from Gemfile

Add the following to your Gemfile file and run the "bundle install" command:

gem 'radarcordrb'

or add the following to your Gemfile file and run the "bundle install" command:.

gem 'radarcordrb', git: 'https://codeberg.org/roxannewolf/radarcordrb'

Usage

Here is a basic example of posting your Discord bot's server count to the radarcord.net website through the radarcord API

require 'radarcordrb'
radarcordapikey = 'RADARCORD_APIKEY'
bot_id = 'DISCORD_BOTID_HERE'
client = Radarcord::Client.new(api_key: radarcordapikey)

begin
    response = client.poststats(bot_id, guilds: 100)
    puts "Stats updated successfully: #{response}"
rescue Radarcord::APIError => e
    puts "Error posting stats: #{e.message}"
end

Here is a basic example for sending an uptime ping through the radarcord API

require 'radarcordrb'
radarcordapikey = 'RADARCORD_APIKEY'
bot_id = 'DISCORD_BOTID_HERE'
client = Radarcord::Client.new(api_key: radarcordapikey)

begin
    response = radarclient.postuptime(bot_id)
    puts "Uptime ping successful: #{response}"
rescue Radarcord::APIError => e
    puts "An error has occured: #{e.message}"
end

[!NOTE] Sending the uptime ping to radarcord's API is manual. Keep in mind of radarcord's ratelimit of 2 minutes for the uptime endpoint. Guard rails are added to the package to respect this limit.

Support and Help

If you need help with this ruby package (a.k.a. Gem), feel free to open an issue on our Gitlab repo or Codeberg repo