qwtf_discord_bot 5.5.5 → 5.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/dashboard.rb +14 -18
- data/lib/qwtf_discord_bot/qwtf_discord_bot_dashboard.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b23056513d2164179b74059da9679cad97749b7b541a72c3cfc5dd5f4cf7f8e
|
4
|
+
data.tar.gz: cdea90ab6a7539a83aa4cb80a8c3766d0931c78ece2d197905b351b53b0a3540
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ae5e3ab1a227bfe61805e53ffdcdb5ceeb90b541eb693a7bb17f45cf510185a0efc004f3f8b6aabc11192aaf413ed5e0510d1720992efcf62d456baeda00169
|
7
|
+
data.tar.gz: 9c012e37ca4c35697513e5ff082d7ab5d6060b05280f9daa01e8aa156848a8cebb3594130e86b1fc3bfcdf148096c3c39ea024b1f01461e6d034aa618a79fb3f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.5.
|
1
|
+
5.5.6
|
data/lib/dashboard.rb
CHANGED
@@ -1,9 +1,18 @@
|
|
1
1
|
class Dashboard
|
2
|
-
def initialize(
|
3
|
-
@
|
4
|
-
@endpoints =
|
5
|
-
@bot = bot
|
2
|
+
def initialize(dashboard_config, bot)
|
3
|
+
@server = bot.server(dashboard_config["server_id"])
|
4
|
+
@endpoints = dashboard_config["endpoints"]
|
6
5
|
@messages = {}
|
6
|
+
|
7
|
+
old_dashboard_channel = @server.channels.find do |chan|
|
8
|
+
chan.name == "dashboard" && chan.topic = "QWTF Bot Dashboard"
|
9
|
+
end
|
10
|
+
|
11
|
+
old_dashboard_channel && old_dashboard_channel.delete
|
12
|
+
|
13
|
+
@channel = @server.create_channel("dashboard")
|
14
|
+
@channel.topic = "QWTF Bot Dashboard"
|
15
|
+
@channel.position = dashboard_config["position"]
|
7
16
|
end
|
8
17
|
|
9
18
|
def update
|
@@ -24,21 +33,8 @@ class Dashboard
|
|
24
33
|
@messages[endpoint] = if @messages[endpoint]
|
25
34
|
@messages[endpoint].edit(nil, embed)
|
26
35
|
else
|
27
|
-
channel.send_embed(nil, embed)
|
36
|
+
@channel.send_embed(nil, embed)
|
28
37
|
end
|
29
38
|
end
|
30
39
|
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
def channel
|
35
|
-
@channel ||= begin
|
36
|
-
data = Discordrb::API::Channel.resolve(
|
37
|
-
"Bot #{QwtfDiscordBot.config.token}",
|
38
|
-
@channel_id
|
39
|
-
)
|
40
|
-
|
41
|
-
Discordrb::Channel.new(JSON.parse(data), @bot)
|
42
|
-
end
|
43
|
-
end
|
44
40
|
end
|
@@ -17,8 +17,10 @@ class QwtfDiscordBotDashboard
|
|
17
17
|
end
|
18
18
|
)
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
bot.run(true)
|
21
|
+
|
22
|
+
@dashboards ||= QwtfDiscordBot.config.dashboards.map do |dashboard_config|
|
23
|
+
Dashboard.new(dashboard_config, bot)
|
22
24
|
end
|
23
25
|
|
24
26
|
every(THIRTY_SECONDS) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qwtf_discord_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.5.
|
4
|
+
version: 5.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sheldon Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: discordrb
|