listcordrb 0.2.0 → 0.3.0

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
  SHA1:
3
- metadata.gz: 86bf85b55bb49caa4c48f709d92d3654bb9988ea
4
- data.tar.gz: d96bccafef48cd42b29f58561eb0c381947cbf06
3
+ metadata.gz: 1b045c166a7bbd2665bfb5c949cc40e58996d451
4
+ data.tar.gz: 4071095ff4149a3a2de858e106e4e4aca70f4108
5
5
  SHA512:
6
- metadata.gz: '0680f6c88b8d3076fc0a0dea9534c6189e9a15aa1711462e561dcb565075ffa544dd395e368f01ea1e739e5758850b1a6fe260d401b556d2575b15fdbc31e9f2'
7
- data.tar.gz: fdd911a3239e07775aa2970f30591df4ed30e4974778e6cc65d2c8a433095832e2a55ab12a092143544ef4d88cc5dff7fd81751526e03cb8409e41220dacc476
6
+ metadata.gz: 97f86c210d40f7031ee88df961365840b088f522ace3e9322a60508c78edbebfc3eaee62b64a3b27fc8df2cd72a7b7889118e31b498c34243f0ab62e971f9806
7
+ data.tar.gz: 6618a70dbde196dece1779797d69c6c0a34a1aa725d7983b9050aec15973387ee8b35ff246c720d20bf0c3b7394a6f98abe13126a3ee65627e405ddafbf825f2
@@ -18,6 +18,20 @@ class ListCordRB
18
18
  @stats = Stats.new(@api, @id)
19
19
  end
20
20
 
21
+ # @return [String] the api key.
22
+ attr_reader :api
23
+
24
+ # @return [Integer] the ID.
25
+ attr_reader :id
26
+
27
+ # Change the api key of the bot.
28
+ # @param key [String] the new api key.
29
+ attr_writer :api
30
+
31
+ # Change the ID of the bot.
32
+ # @param id [Integer] the new ID.
33
+ attr_writer :id
34
+
21
35
  # Load a bot.
22
36
  # @param id [Integer, String] Integer/String ID of the bot you're requesting.
23
37
  def loadbot(id)
@@ -124,4 +124,18 @@ class ListCordRB::Bot
124
124
  def owners
125
125
  @data['owners']
126
126
  end
127
+
128
+ # Is the bot online or not?.
129
+ # @return [true, false] the bot's online status.
130
+ def online?
131
+ @data['online']
132
+ end
133
+
134
+ alias online online?
135
+
136
+ # The amount of times the invite button has been clicked for the bot.
137
+ # @return [Integer] the amount of times the bot has been invited.
138
+ def invites
139
+ @data['invites']
140
+ end
127
141
  end
@@ -16,9 +16,12 @@ class ListCordRB::Stats
16
16
  alias servercount servers
17
17
 
18
18
  # Update the bot's server count.
19
- def servers=(count)
19
+ def servers=(count, shard = nil)
20
20
  url = "http://listcord.com/api/bot/#{@id}/guilds"
21
- json = '{"guilds":' + count.to_s + '}'
21
+ json = {
22
+ 'guilds' => count.to_s,
23
+ 'shard' => shard.to_s
24
+ }
22
25
  RestClient.post(url, json, :Authorization => @api, :'Content-Type' => :json)
23
26
  end
24
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: listcordrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.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-07-01 00:00:00.000000000 Z
11
+ date: 2018-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client