qwtf_discord_bot 5.5.20 → 5.5.25
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/Gemfile +1 -1
- data/Gemfile.lock +7 -7
- data/VERSION +1 -1
- data/lib/dashboard.rb +7 -7
- data/lib/qstat_request.rb +6 -3
- data/lib/qwtf_discord_bot/qwtf_discord_bot_pug.rb +6 -14
- data/qwtf_discord_bot.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d52936b5b37ec73ab1ff18e5d94a0df663d447181128a5f981f64d1f8825aac
|
4
|
+
data.tar.gz: 8e6e8bf18c681875d97e49f6480984f7b702405c85435a1e77be8491b5db4cd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfc50cb1f497ff1428986370e6aae8f5e507ad5ede8317075a15a1e0b52e487ab41367af4d3167a44080b0e95b5a5d2c85c34b579431928180c981ae98474c42
|
7
|
+
data.tar.gz: 462efd6d2e12a17f389bf7d9a94e6da4e7104291098bd080125e9b7f9a38cefe0414a13ce9a10e90a3d0deda429e01af047a7e29b0f94a0294c141f135803622
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
qwtf_discord_bot (5.5.
|
5
|
-
discordrb (
|
4
|
+
qwtf_discord_bot (5.5.25)
|
5
|
+
discordrb (= 3.4.0)
|
6
6
|
redis (~> 4.2)
|
7
7
|
thor (~> 1.1)
|
8
8
|
|
@@ -18,14 +18,14 @@ GEM
|
|
18
18
|
coderay (1.1.3)
|
19
19
|
concurrent-ruby (1.1.8)
|
20
20
|
diff-lcs (1.4.4)
|
21
|
-
discordrb (3.4.
|
22
|
-
discordrb-webhooks (~> 3.
|
21
|
+
discordrb (3.4.0)
|
22
|
+
discordrb-webhooks (~> 3.3.0)
|
23
23
|
ffi (>= 1.9.24)
|
24
24
|
opus-ruby
|
25
25
|
rest-client (>= 2.0.0)
|
26
26
|
websocket-client-simple (>= 0.3.0)
|
27
|
-
discordrb-webhooks (3.
|
28
|
-
rest-client (>= 2.0.
|
27
|
+
discordrb-webhooks (3.3.0)
|
28
|
+
rest-client (>= 2.1.0.rc1)
|
29
29
|
domain_name (0.5.20190701)
|
30
30
|
unf (>= 0.0.5, < 1.0.0)
|
31
31
|
event_emitter (0.2.6)
|
@@ -84,7 +84,7 @@ PLATFORMS
|
|
84
84
|
|
85
85
|
DEPENDENCIES
|
86
86
|
bundler
|
87
|
-
discordrb
|
87
|
+
discordrb (= 3.4.0)
|
88
88
|
factory_bot
|
89
89
|
pry
|
90
90
|
qwtf_discord_bot!
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.5.
|
1
|
+
5.5.25
|
data/lib/dashboard.rb
CHANGED
@@ -2,6 +2,8 @@ class Dashboard
|
|
2
2
|
def initialize(dashboard_config, bot)
|
3
3
|
@server = bot.server(dashboard_config["server_id"])
|
4
4
|
@endpoints = dashboard_config["endpoints"]
|
5
|
+
@messages = {}
|
6
|
+
|
5
7
|
|
6
8
|
channel_name = dashboard_config["name"]
|
7
9
|
|
@@ -32,15 +34,13 @@ class Dashboard
|
|
32
34
|
end
|
33
35
|
|
34
36
|
def update
|
35
|
-
messages = {}
|
36
|
-
|
37
37
|
@endpoints.each do |endpoint|
|
38
38
|
qstat_request = QstatRequest.new(endpoint)
|
39
39
|
|
40
40
|
if qstat_request.is_empty?
|
41
|
-
if messages[endpoint]
|
42
|
-
messages[endpoint].delete
|
43
|
-
messages.delete(endpoint)
|
41
|
+
if @messages[endpoint]
|
42
|
+
@messages[endpoint].delete
|
43
|
+
@messages.delete(endpoint)
|
44
44
|
end
|
45
45
|
|
46
46
|
next
|
@@ -48,8 +48,8 @@ class Dashboard
|
|
48
48
|
|
49
49
|
embed = qstat_request.to_full_embed
|
50
50
|
|
51
|
-
messages[endpoint] = if messages[endpoint]
|
52
|
-
messages[endpoint].edit(nil, embed)
|
51
|
+
@messages[endpoint] = if @messages[endpoint]
|
52
|
+
@messages[endpoint].edit(nil, embed)
|
53
53
|
else
|
54
54
|
@channel.send_embed(nil, embed)
|
55
55
|
end
|
data/lib/qstat_request.rb
CHANGED
@@ -17,7 +17,7 @@ class QstatRequest
|
|
17
17
|
embed = Discordrb::Webhooks::Embed.new
|
18
18
|
|
19
19
|
teams.each do |team|
|
20
|
-
embed
|
20
|
+
embed << team.to_embed_field
|
21
21
|
end
|
22
22
|
|
23
23
|
embed
|
@@ -31,7 +31,7 @@ class QstatRequest
|
|
31
31
|
)
|
32
32
|
|
33
33
|
teams.each do |team|
|
34
|
-
embed
|
34
|
+
embed << team.to_embed_field
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -115,7 +115,10 @@ class QstatRequest
|
|
115
115
|
end
|
116
116
|
|
117
117
|
def name
|
118
|
-
data['name']
|
118
|
+
name = data['name']
|
119
|
+
return address if name.empty?
|
120
|
+
|
121
|
+
name
|
119
122
|
end
|
120
123
|
|
121
124
|
def address
|
@@ -735,13 +735,9 @@ class QwtfDiscordBotPug # :nodoc:
|
|
735
735
|
end
|
736
736
|
|
737
737
|
embed.add_field(
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
name: team_name(team_no),
|
742
|
-
value: team_display_names.join("\n")
|
743
|
-
}
|
744
|
-
)
|
738
|
+
inline: true,
|
739
|
+
name: team_name(team_no),
|
740
|
+
value: team_display_names.join("\n")
|
745
741
|
)
|
746
742
|
end
|
747
743
|
end
|
@@ -775,13 +771,9 @@ class QwtfDiscordBotPug # :nodoc:
|
|
775
771
|
end
|
776
772
|
|
777
773
|
embed.add_field(
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
name: team_name(team_no),
|
782
|
-
value: team_mentions.join("\n")
|
783
|
-
}
|
784
|
-
)
|
774
|
+
inline: true,
|
775
|
+
name: team_name(team_no),
|
776
|
+
value: team_mentions.join("\n")
|
785
777
|
)
|
786
778
|
end
|
787
779
|
end
|
data/qwtf_discord_bot.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ['lib']
|
29
29
|
|
30
|
-
spec.add_runtime_dependency 'discordrb', '
|
30
|
+
spec.add_runtime_dependency 'discordrb', '3.4.0'
|
31
31
|
spec.add_runtime_dependency 'redis', '~> 4.2'
|
32
32
|
spec.add_runtime_dependency 'thor', '~>1.1'
|
33
33
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
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.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sheldon Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: discordrb
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.4.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: redis
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|