topgg 1.0.2 → 1.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cbae83079b3b78337e9006b5850b43a609d5b14f95d05a0a8c30e16a7a1075e
4
- data.tar.gz: 89d011bb153dbab77d40a5c2fb2afb09c8345f14807acb5593746280fd25ca56
3
+ metadata.gz: 31766351920f959f50e2aaa07350ac7c82d436c61e580b490d5db71d0ea8cbc5
4
+ data.tar.gz: 7ac395e026c798bf48016c9b49ef20606fb238d0165fe8d945d411d242184eab
5
5
  SHA512:
6
- metadata.gz: 242cdd6fbce9eea79010911afc0223d5611a65689e3332d2ff7d2cbc050e431ce138b77617e6d4c53e38f43e1f6452bd09165be7edcf2374e1bd05ae7a18d76d
7
- data.tar.gz: 7d2fe752e4f83879594909fd6d96fa699227b9bb4c9e3bfa851c28341739365f170a3825304155c0c17bb86df95d369bda42467d72d388822b76f58a0a6d61bb
6
+ metadata.gz: b5ce9dc541fb6edfeb6a90ca2e6b5fda537a469942a651074c03191b9e3743e5d4f95e1b57b71da2cc22c0c67db5b0c2ba68978e0e94c63bd83f1b85ffb6a4bc
7
+ data.tar.gz: 704b4fb2bfdb2f58eee599c6d54e18a298a57daa3771d4ed6060fdec566c9797c8e404f9854ca106073c3f0fa317c1201fd6d2350668d713dbb86639051d7c69
data/lib/lib.rb CHANGED
@@ -24,20 +24,18 @@ class Topgg
24
24
  # The method fetches bot statistics from top.gg
25
25
  # @param id [String] The id of the bot you want to fetch statistics from.
26
26
  # @return [Spreader::Bot] The Bot Object
27
- def getBot(id)
27
+ def get_bot(id)
28
28
  resp = @conn.get("bots/#{id}")
29
29
 
30
30
  Spreader::Bot.new(JSON.parse(resp.body))
31
31
  end
32
32
 
33
33
  # The method searches bots from top.gg using a keyword query.
34
- # @param query [String] the search term
35
- # @param limit [Integer] the amount of results to return
36
- # @param offset [Integer] The Amount of bots to skip
37
- # @param sort [Boolean] The fields to sort by.
34
+ # @param [Object] params The parameters that can be used to query a search
35
+ # To know what the parameters are check it out here
38
36
  # @return [Spreader::BotSearch] The BotSearch Object
39
- def searchBot(query, limit: 50, offset: 0, sort: nil, fields: nil)
40
- resp = @conn.get('bots', { search: query, limit: limit, offset: offset, sort: sort, fields: fields })
37
+ def search_bot(params)
38
+ resp = @conn.get('bots', params)
41
39
  Spreader::BotSearch.new(JSON.parse(resp.body))
42
40
  end
43
41
 
@@ -53,7 +51,7 @@ class Topgg
53
51
  # Get Bot statistics.
54
52
  # @param id [String] Id of the bot you want to get statistics of
55
53
  # @return [Spreader::Stats]
56
- def getStats(id)
54
+ def get_stats(id)
57
55
  resp = @conn.get("bots/#{id}/stats")
58
56
 
59
57
  Spreader::Stats.new(JSON.parse(resp.body))
@@ -81,7 +79,7 @@ class Topgg
81
79
  # @param server_count [Integer] The amount of servers the bot is in.
82
80
  # @param shards [Integer] The amount of servers the bot is in per shard
83
81
  # @param shard_count [Integer] The total number of shards.
84
- def postStats(server_count, shards: nil, shard_count: nil)
82
+ def post_stats(server_count, shards: nil, shard_count: nil)
85
83
  jsonPost = {
86
84
  server_count: server_count,
87
85
  shards: shards,
@@ -92,7 +90,7 @@ class Topgg
92
90
 
93
91
  # Autopost stats on to the top.gg website
94
92
  # @param client [Discordrb::Bot] instanceof discordrb client.
95
- def autoPostStats(client)
93
+ def auto_post_stats(client)
96
94
  semaphore = Mutex.new
97
95
  Thread.new do
98
96
  semaphore.synchronize do
@@ -121,3 +119,4 @@ class Topgg
121
119
  end
122
120
 
123
121
 
122
+
@@ -14,7 +14,7 @@ module Spreader
14
14
  # The Total number of results
15
15
  # @return [Integer]
16
16
  def total
17
- @obj['total']
17
+ @obj['total'].to_i
18
18
  end
19
19
 
20
20
  # The first result
@@ -26,7 +26,7 @@ module Spreader
26
26
  # The number of bots shown in the first page
27
27
  # @return [Integer]
28
28
  def count
29
- @obj['count']
29
+ @obj['count'].to_i
30
30
  end
31
31
 
32
32
  # Iterates through the results
Binary file
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.2'
5
+ spec.version = '1.0.3'
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.2
4
+ version: 1.0.3
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-06-29 00:00:00.000000000 Z
11
+ date: 2021-07-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a ruby library of the top.gg API.
14
14
  email:
@@ -30,6 +30,7 @@ files:
30
30
  - lib/topgg/user.rb
31
31
  - lib/topgg/votes.rb
32
32
  - pkg/topgg-1.0.1.gem
33
+ - pkg/topgg-1.0.2.gem
33
34
  - topgg.gemspec
34
35
  homepage: https://github.com/rhydderchc/topgg-ruby
35
36
  licenses: