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 +4 -4
- data/lib/listcordrb.rb +14 -0
- data/lib/listcordrb/bot.rb +14 -0
- data/lib/listcordrb/stats.rb +5 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b045c166a7bbd2665bfb5c949cc40e58996d451
|
4
|
+
data.tar.gz: 4071095ff4149a3a2de858e106e4e4aca70f4108
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97f86c210d40f7031ee88df961365840b088f522ace3e9322a60508c78edbebfc3eaee62b64a3b27fc8df2cd72a7b7889118e31b498c34243f0ab62e971f9806
|
7
|
+
data.tar.gz: 6618a70dbde196dece1779797d69c6c0a34a1aa725d7983b9050aec15973387ee8b35ff246c720d20bf0c3b7394a6f98abe13126a3ee65627e405ddafbf825f2
|
data/lib/listcordrb.rb
CHANGED
@@ -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)
|
data/lib/listcordrb/bot.rb
CHANGED
@@ -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
|
data/lib/listcordrb/stats.rb
CHANGED
@@ -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 =
|
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.
|
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-
|
11
|
+
date: 2018-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|