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 +4 -4
- data/VERSION +1 -1
- data/lib/qwtf_discord_bot/qwtf_discord_bot_pug.rb +21 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b813d466ddbf8c36a783f042850df267dc0669497e109abd2216c32a39c6e41e
|
4
|
+
data.tar.gz: 2fc6dcf207ed665bc51a5a54d1173512236eca9842a7998e270d6f21f6cad70d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b856f195e9ec4e47c660d7463192a76ba669d58216edea8b7bc93e2a9e9ded6283de6183ebdf8bc526e88c092fd9d0637d39a6286dbd83d5264ab059aba18081
|
7
|
+
data.tar.gz: 15fb7c42819c3cff35a02b2971502225b8218b442277cbcf042fd20d31756638b1e073f374169c59b7e3c084311cc844a0f731efff98f89e68b6122a1009153a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.5.
|
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
|
-
|
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",
|