qwtf_discord_bot 5.3.5 → 5.3.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e4ea9a3df5bcc8c8cb14ba1d22a0708bdf8c4a994531d4c06fb8bbc75b33410
4
- data.tar.gz: 1568efc1c854b8d4d43d60fd0caa48b0e52e4b09ca04336b6b8c1969090fb146
3
+ metadata.gz: 45dcf6ff7c764cda796f9048dde0184423bab3f0a45b6bd3d58341876435d6bc
4
+ data.tar.gz: f8e192337a8247a1fde818d5b1d53922d350734708ecaa0e1cf36865d1b3caff
5
5
  SHA512:
6
- metadata.gz: 50d22f311c0c29ce8df6f1a9c473559812a60d7602f79aa2a9976ffec4a44b6e2f096d6c7c7ac45d390569854393ea14b4ca2afa7f6b7213ba093330221bf48e
7
- data.tar.gz: cb34ac9dd1c0f5ff46c09700c1998c8e0cae344cc4b0944a40e2c8fad25bb46cfe3db8ab202e0079f20d982d1dfe74382cf01efe152484abc7f652a83008316f
6
+ metadata.gz: 0db6a8a62cbc130860904b63d169b4942b5264643fa507ee566dd3abddee682b1182b920eb1a06c83b044edebf5879cc88587dd94c1b520b5a9054608c072647
7
+ data.tar.gz: 62de3a2ef18d87b20c4804e9c311663d043b6c32d9aa9209ef63a94fa870cc1a589b27027613e44f319cf4ed1e1de8dc76a980cf0bcc1cc433c306454cb440fc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.3.5
1
+ 5.3.6
@@ -204,9 +204,13 @@ 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
- actual_teams = pug.teams.reject { |k| k == "0" }
207
+ if pug.actual_teams.count < 2
208
+ return send_msg(
209
+ "There must be at least two teams with players to submit a result", e.channel
210
+ )
211
+ end
208
212
 
209
- team_results = actual_teams.inject({}) do |teams, (name, player_ids)|
213
+ team_results = pug.actual_teams.inject({}) do |teams, (name, player_ids)|
210
214
  players = player_ids.inject({}) do |memo, id|
211
215
  memo.merge({ id => e.display_name_for(id) })
212
216
  end
@@ -219,7 +223,11 @@ class QwtfDiscordBotPug # :nodoc:
219
223
  {
220
224
  match: {
221
225
  map: pug.game_map,
222
- teams: team_results
226
+ teams: team_results,
227
+ discord_channel: {
228
+ channel_id: e.channel_id,
229
+ name: "#{e.channel.server.name} ##{e.channel.name}"
230
+ }
223
231
  }
224
232
  }.to_json
225
233
  )
@@ -242,9 +250,13 @@ class QwtfDiscordBotPug # :nodoc:
242
250
  setup_pug(event) do |e, pug|
243
251
  return send_msg(no_active_pug_message, e.channel) unless pug.active?
244
252
 
245
- actual_teams = pug.teams.reject! { |k| k == "0" }
253
+ if pug.actual_teams.count < 2
254
+ return send_msg(
255
+ "There must be at least two teams with players to submit a result", e.channel
256
+ )
257
+ end
246
258
 
247
- team_results = actual_teams.inject({}) do |teams, (name, player_ids)|
259
+ team_results = pug.actual_teams.inject({}) do |teams, (name, player_ids)|
248
260
  players = player_ids.inject({}) do |memo, id|
249
261
  memo.merge({ id => e.display_name_for(id) })
250
262
  end
@@ -256,7 +268,11 @@ class QwtfDiscordBotPug # :nodoc:
256
268
  {
257
269
  match: {
258
270
  map: pug.game_map,
259
- teams: team_results
271
+ teams: team_results,
272
+ discord_channel: {
273
+ channel_id: e.channel_id,
274
+ name: "#{e.channel.server.name} ##{e.channel.name}"
275
+ }
260
276
  }
261
277
  }.to_json
262
278
  )
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.5
4
+ version: 5.3.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-10-07 00:00:00.000000000 Z
11
+ date: 2020-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: discordrb