dblruby 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dblruby/stats.rb +7 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03cc39920d1adcff5394fb49b8a646e76400194b
4
- data.tar.gz: f5ee8b7c4b13f33f0b4ed8ac6aa01c139602c367
3
+ metadata.gz: 63fce355427db5e0ccc5261f36ace592372f7562
4
+ data.tar.gz: 4bfd62fa6caa062ec8df81d955fbdbe085db0404
5
5
  SHA512:
6
- metadata.gz: 8541b9146c8b546d8b83cbcfffff2714691c0b0477b434ea3ab2817be0bbb909cfb7e226137141acb10bf31afe84599ed10ee6ad25bf4ec46dbc50b17a5cbb22
7
- data.tar.gz: 1c35c6fd1e2fbbf8810f7fb1dab84a01aee825d5f5c670071537a4aee0dbfe7ac9032a56096809c1f39b3a364d1d451f360501eef466df4279fda5e249752ca4
6
+ metadata.gz: d73ffedc5fec86dbacf51449904ad02470d3d4950a8b36bf49f249db6900022c4c04b084d4d0f21b0aa0720c256a80b918144b9cae35b3f232a421a82cabea45
7
+ data.tar.gz: fa724a53740a95390fa632fb6fd0807dc38e6200d8d67dfa245b5cc2ee3c836ebd52e69045d0462cbca016db1d97e89614c1a40e2b21e58dc0c89767169dc120
@@ -12,4 +12,11 @@ class DBLRuby::Stats
12
12
  url = "https://discordbots.org/api/bots/#{@id}"
13
13
  JSON.parse(RestClient.get(url))['server_count'].to_i
14
14
  end
15
+
16
+ def updateservercount(count)
17
+ url = "https://discordbots.org/api/bots/#{@id}/stats"
18
+ json = '{"server_count":' + count.to_s + '}'
19
+ RestClient.post(url, json, :Authorization => @api, :'Content-Type' => :json)
20
+ "Successfully set the server count to #{count}"
21
+ end
15
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dblruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chewsterchew
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-19 00:00:00.000000000 Z
11
+ date: 2018-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client