Skip to content

A ruby library for the top.gg api

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt
Notifications You must be signed in to change notification settings

rhygg/ruby-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Top.gg Ruby

This Software Development Kit provides you with a wrapper to the top.gg api, that allows you to fetch data from the top.gg api and post data such as statistics to the website.

Dependencies

  • Ruby
  • Faraday (The client to automate requests)

Installation

Example

Here's a straightforward example of how to request data with the wrapper.

require 'topgg'

client = Topgg.new("AUTH_TOKEN", "BOTID")

client.get_bot("1234").defAvatar
# returns
# "6debd47ed13483642cf09e832ed0bc1b"

AutoPosting

The library provides you with autoposting functionality, and autoposts statistics every 30 minutes, automatically! Here's how you can enable it

require 'topgg'
require 'discordrb'

bot = Discordrb::Bot.new token: "TOKEN"

client = Topgg.new("AUTH_TOKEN", "BOTID")
 bot.ready do |event|
 client.auto_post_stats(bot) # The discordrb bot client.
end
bot.run

Documentation

Check out the documentation here

About

A ruby library for the top.gg api

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%