prismarb 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 +4 -4
- data/lib/prismarb.rb +8 -8
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 349d4cea04de26a14ca63ee5df858025b91bc50c21e10c36587468491845469b
|
|
4
|
+
data.tar.gz: 57f899e66aecff00c411d6c7c6fbc9e7614868f0df20b990e7bfd04ca3d3208a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ea3c13b6b21f9c0b53f3903ee733458323fb124db97a535e66c17086987f8e2bf93b220126b23348bddb9895ee9704d13fa3b4251c1cc6b31581a478180eb922
|
|
7
|
+
data.tar.gz: 58842232d34535ed1e9ebbd38c6ef362d18802df7a0099181b6ebf935aa80d9924bf83062707c6ddfddbc75f074652031c87b488bc2613b771a2f1e6df9f0b0b
|
data/lib/prismarb.rb
CHANGED
|
@@ -15,9 +15,9 @@ module Prismarb
|
|
|
15
15
|
def process_data(message, server)
|
|
16
16
|
message = message.content.split(" ")[0]
|
|
17
17
|
if @commands.has_key? message
|
|
18
|
-
|
|
18
|
+
@commands[message] += 1
|
|
19
19
|
else
|
|
20
|
-
|
|
20
|
+
@commands[message] = 1
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
match = @servers.find { |i| i["name"] == server.name }
|
|
@@ -40,13 +40,13 @@ module Prismarb
|
|
|
40
40
|
processes data and sends every 2 minutes
|
|
41
41
|
TODO: refactor so that users don't need to use ctx
|
|
42
42
|
"""
|
|
43
|
-
unset =
|
|
43
|
+
unset = false
|
|
44
44
|
if @time.nil?
|
|
45
45
|
@time = Time.now
|
|
46
|
-
unset =
|
|
46
|
+
unset = true
|
|
47
47
|
end
|
|
48
48
|
server = message.guild
|
|
49
|
-
|
|
49
|
+
process_data(message, server)
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
curr_time = Time.now
|
|
@@ -54,9 +54,9 @@ module Prismarb
|
|
|
54
54
|
if (unset or interval > 5)
|
|
55
55
|
@time = curr_time
|
|
56
56
|
data = {
|
|
57
|
-
"commands":
|
|
58
|
-
"save_server":
|
|
59
|
-
"servers":
|
|
57
|
+
"commands": @commands,
|
|
58
|
+
"save_server": @save_server,
|
|
59
|
+
"servers": @servers
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
Net::HTTP.post URI('https://prismalytics.herokuapp.com/send_data'),
|