qwtf_discord_bot 5.3.3 → 5.3.4
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/qwtf_discord_bot/qwtf_discord_bot_pug.rb +9 -5
- 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: 287ada88fe7e7e8db0a61816eb5872adf7aa51aae6ceed90d55e446d42222484
|
4
|
+
data.tar.gz: 44b89de85fea1a429a14418d3fd0d5b3aabc7dec291502176a9ab16d5de45d69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a3ea4bf9ef15c27795e60610a981948487eb626f65edd34eca71da52b3752f9134574598695ffe870046e9ea4f59e8feaa360ac76bdf3a3abe4a043c5bdcaec
|
7
|
+
data.tar.gz: d06a5a2efacdee2ee0ba62e180d9ee82dcacabc469828459619dc15174851b78aa726fcb35f56c0114eb843afeb83c3f15a2ff4c1c7a74684d3683394ffac746
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.3.
|
1
|
+
5.3.4
|
@@ -137,7 +137,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
137
137
|
return send_msg("Which team? E.G. `!team 1`", e.channel) unless args.any?
|
138
138
|
|
139
139
|
team_no = args[0].to_i
|
140
|
-
return send_msg("Choose a team between
|
140
|
+
return send_msg("Choose a team between 0 and 4", e.channel) unless team_no.between?(0, 4)
|
141
141
|
|
142
142
|
pug_already_full = pug.full?
|
143
143
|
|
@@ -204,13 +204,15 @@ class QwtfDiscordBotPug # :nodoc:
|
|
204
204
|
|
205
205
|
return send_msg("Not a valid team", e.channel) unless pug.team(winning_team_no).any?
|
206
206
|
|
207
|
-
|
207
|
+
actual_teams = pug.teams.reject! { |k| k == "0" }
|
208
|
+
|
209
|
+
team_results = actual_teams.inject({}) do |teams, (name, player_ids)|
|
208
210
|
players = player_ids.inject({}) do |memo, id|
|
209
211
|
memo.merge({ id => e.display_name_for(id) })
|
210
212
|
end
|
211
213
|
|
212
|
-
|
213
|
-
|
214
|
+
result = winning_team_no.to_i == name.to_i ? 1 : -1
|
215
|
+
teams.merge({ name => { players: players, result: result } })
|
214
216
|
end
|
215
217
|
|
216
218
|
post_results(
|
@@ -240,7 +242,9 @@ class QwtfDiscordBotPug # :nodoc:
|
|
240
242
|
setup_pug(event) do |e, pug|
|
241
243
|
return send_msg(no_active_pug_message, e.channel) unless pug.active?
|
242
244
|
|
243
|
-
|
245
|
+
actual_teams = pug.teams.reject! { |k| k == "0" }
|
246
|
+
|
247
|
+
team_results = actual_teams.inject({}) do |teams, (name, player_ids)|
|
244
248
|
players = player_ids.inject({}) do |memo, id|
|
245
249
|
memo.merge({ id => e.display_name_for(id) })
|
246
250
|
end
|
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.3.
|
4
|
+
version: 5.3.4
|
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-10-
|
11
|
+
date: 2020-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: discordrb
|