topgg 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lib.rb +9 -9
  3. data/topgg.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31766351920f959f50e2aaa07350ac7c82d436c61e580b490d5db71d0ea8cbc5
4
- data.tar.gz: 7ac395e026c798bf48016c9b49ef20606fb238d0165fe8d945d411d242184eab
3
+ metadata.gz: fbdd8160537319a98455be19d2e3ad6d0691d6a3508d56dd6688f356879eb6c0
4
+ data.tar.gz: 077e57202742fc1d871e35fcb2f91ec226d60b8b317d1d10964f17a8a9aa57e9
5
5
  SHA512:
6
- metadata.gz: b5ce9dc541fb6edfeb6a90ca2e6b5fda537a469942a651074c03191b9e3743e5d4f95e1b57b71da2cc22c0c67db5b0c2ba68978e0e94c63bd83f1b85ffb6a4bc
7
- data.tar.gz: 704b4fb2bfdb2f58eee599c6d54e18a298a57daa3771d4ed6060fdec566c9797c8e404f9854ca106073c3f0fa317c1201fd6d2350668d713dbb86639051d7c69
6
+ metadata.gz: b9e65d4ff9ab1b84d6300a3fea75e941de62496a7cbb1d3030773e1427cd2c77359a1ed141a14aa7b65bed93e12e2b774abc3f629146e9fe0b4737eb4d745c95
7
+ data.tar.gz: ea5d810c1e3a57b781fbefd4f83085484d01f454346135852c5906f0b1984eda9bc9766c958e43ea57be4786998f093094775cb2eb87cbca8a91ebbca2336f14
data/lib/lib.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'faraday'
3
4
  require 'json'
4
5
  require_relative 'topgg/bot'
@@ -80,23 +81,23 @@ class Topgg
80
81
  # @param shards [Integer] The amount of servers the bot is in per shard
81
82
  # @param shard_count [Integer] The total number of shards.
82
83
  def post_stats(server_count, shards: nil, shard_count: nil)
83
- jsonPost = {
84
+ json_post = {
84
85
  server_count: server_count,
85
86
  shards: shards,
86
87
  shard_count: shard_count
87
88
  }.to_json
88
- @conn.post("bots/#{@id}/stats", jsonPost, { 'Content-Type' => 'application/json' })
89
+ @conn.post("bots/#{@id}/stats", json_post, { 'Content-Type' => 'application/json' })
89
90
  end
90
91
 
91
- # Autopost stats on to the top.gg website
92
+ # Auto-posts stats on to the top.gg website
92
93
  # @param client [Discordrb::Bot] instanceof discordrb client.
93
94
  def auto_post_stats(client)
94
95
  semaphore = Mutex.new
95
96
  Thread.new do
96
97
  semaphore.synchronize do
97
98
  interval 1800 do
98
- serverLen = client.servers.length
99
- postStats(serverLen)
99
+ server_len = client.servers.length
100
+ post_stats(server_len)
100
101
  print("[TOPGG] : \033[31;1;4m Bot statistics has been successfully posted!\033[0m")
101
102
  end
102
103
  end
@@ -104,16 +105,15 @@ class Topgg
104
105
  end
105
106
 
106
107
  # Mini-method to get statistics on self
107
- # @return [getBot]
108
+ # @return [get_bot]
108
109
  def self
109
- getBot(@id)
110
+ get_bot(@id)
110
111
  end
111
112
 
112
113
  def interval(seconds)
113
114
  loop do
114
115
  yield
115
- sleep seconds
116
-
116
+ sleep seconds
117
117
  end
118
118
  end
119
119
  end
data/topgg.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'topgg'
5
- spec.version = '1.0.3'
5
+ spec.version = '1.0.4'
6
6
  spec.authors = ['Adonis Tremblay']
7
7
  spec.email = ['rhydderchc@gmail.com']
8
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: topgg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adonis Tremblay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-05 00:00:00.000000000 Z
11
+ date: 2021-08-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a ruby library of the top.gg API.
14
14
  email: