qwtf_discord_bot 5.5.14 → 5.5.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3106f91d2202ab45546b2b082f865db04dc8bf5e69c165101dd6e23f1fa4e9c7
4
- data.tar.gz: 012b9c79d830fdcc7c2ff70a6dcdc7fe8e8e16039571723dce5ff23f71f6996e
3
+ metadata.gz: b813d466ddbf8c36a783f042850df267dc0669497e109abd2216c32a39c6e41e
4
+ data.tar.gz: 2fc6dcf207ed665bc51a5a54d1173512236eca9842a7998e270d6f21f6cad70d
5
5
  SHA512:
6
- metadata.gz: a8dfbdf3eac06edf1641e74984d43ddf210978f51d3879c1628ed38fab29b118a8b5fb3fc8938a841d2fc5884d270d05a17b25334870c84e3c7998557ffe17fa
7
- data.tar.gz: '000608afc046e58aa735fefc2cb7c4a5d13709e1b1abc93cc9bae1791d7184e33956ed54ff798f56ce700f7827b8a272108c7b24c95438677eb89ff7ef494f3d'
6
+ metadata.gz: b856f195e9ec4e47c660d7463192a76ba669d58216edea8b7bc93e2a9e9ded6283de6183ebdf8bc526e88c092fd9d0637d39a6286dbd83d5264ab059aba18081
7
+ data.tar.gz: 15fb7c42819c3cff35a02b2971502225b8218b442277cbcf042fd20d31756638b1e073f374169c59b7e3c084311cc844a0f731efff98f89e68b6122a1009153a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.5.14
1
+ 5.5.15
@@ -46,6 +46,13 @@ class QwtfDiscordBotPug # :nodoc:
46
46
 
47
47
  bot.command :choose do |event, *args|
48
48
  setup_pug(event) do |e, pug|
49
+ if pug.joined_players.count > pug.maxplayers
50
+ return send_embedded_message(
51
+ description: "Too many players, increase `!teamsize` or `!kick` extras",
52
+ channel: event.channel
53
+ )
54
+ end
55
+
49
56
  if pug.joined_players.count.odd?
50
57
  return send_embedded_message(
51
58
  description: "Can't choose teams with odd number of players",
@@ -240,7 +247,13 @@ class QwtfDiscordBotPug # :nodoc:
240
247
  )
241
248
  end
242
249
 
243
- join_pug(e, pug) unless pug.joined?(user_id)
250
+ if pug.team(team_no).size >= pug.teamsize
251
+ return send_embedded_message(
252
+ description: "Team is full",
253
+ channel: e.channel
254
+ )
255
+ end
256
+
244
257
  pug.join_team(team_no: team_no, player_id: user_id)
245
258
 
246
259
  send_embedded_message(
@@ -252,6 +265,13 @@ class QwtfDiscordBotPug # :nodoc:
252
265
  )
253
266
  else
254
267
  args[1..-1].each do |mention|
268
+ if pug.team(team_no).size >= pug.teamsize
269
+ return send_embedded_message(
270
+ description: "Team is full",
271
+ channel: e.channel
272
+ )
273
+ end
274
+
255
275
  unless mention.match(/<@!\d+>/)
256
276
  send_embedded_message(
257
277
  description: "#{arg} isn't a valid mention",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qwtf_discord_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.14
4
+ version: 5.5.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sheldon Johnson