qwtf_discord_bot 5.4.12 → 5.4.13

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: 4b277234b785000212e913859cac63c94fc2c125bf6c2723ed5b7df6ba7419a7
4
- data.tar.gz: b55f4861185865fb3b7bb8ceb19ddad26ebaef334aa02cc7e7504e0b6bf74a20
3
+ metadata.gz: 256bc5dd2a321a2e9495764c946142a36bdc4cec6f4871a70c3d8b2b6e0d1357
4
+ data.tar.gz: 16d3964888b04bdb1580ef62b1541375876dfdd2a24847ff60bc2927871f8ab3
5
5
  SHA512:
6
- metadata.gz: db1415cd7144dbf88b0343cabf2d05daed1fc8da377a25c2d32117d7d84be9f7cb4fdbd96d16c5084a2abf00d78d7318baaff8accd96a6723657867fdcfb7422
7
- data.tar.gz: 5af029b8abd9cf20438ae815ca4e6234b23c0d2279c3884bc0d267d31e06f7a91de523b0276719a7a37e6c373d14795b39e2e5b6774d84956828490834d5fc47
6
+ metadata.gz: c153a53da144bd6af78ea5013dd080d1f7da909ec532da2fa3787aa872ef03d778aaf30857d63ed204934cdfe5be3ff23aab166f6a747291ccb67f94ea23f10e
7
+ data.tar.gz: 986cc092056e071b8dcd877a4869d98911e9366253842f48e75df0f333445bfab71da2a6bab20e8242127a38a4fa187c930279497a3b632bc81ad63327972b65
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.4.12
1
+ 5.4.13
@@ -288,26 +288,47 @@ class QwtfDiscordBotPug # :nodoc:
288
288
  )
289
289
  end
290
290
 
291
- unless pug.joined?(user_id)
292
- return send_embedded_message(
293
- description: "You aren't in this PUG",
294
- channel: e.channel
295
- )
296
- end
291
+ if args.empty?
292
+ unless pug.joined?(user_id)
293
+ return send_embedded_message(
294
+ description: "You aren't in this PUG",
295
+ channel: e.channel
296
+ )
297
+ end
297
298
 
298
- if pug.team(0).include?(user_id)
299
- return send_embedded_message(
300
- description: "You aren't in a team",
299
+ if pug.team(0).include?(user_id)
300
+ return send_embedded_message(
301
+ description: "You aren't in a team",
302
+ channel: e.channel
303
+ )
304
+ end
305
+
306
+ pug.join_team(team_no: 0, player_id: user_id)
307
+
308
+ send_embedded_message(
309
+ description: "#{e.display_name} leaves team",
301
310
  channel: e.channel
302
311
  )
303
- end
312
+ else
313
+ args.each do |mention|
314
+ unless mention.match(/<@!\d+>/)
315
+ send_embedded_message(
316
+ description: "#{arg} isn't a valid mention",
317
+ channel: e.channel
318
+ )
319
+ next
320
+ end
304
321
 
305
- pug.join_team(team_no: 0, player_id: user_id)
322
+ user_id = mention_to_user_id(mention)
323
+ display_name = e.display_name_for(user_id) || arg
324
+ pug.join_team(team_no: 0, player_id: user_id)
306
325
 
307
- send_embedded_message(
308
- description: "#{e.display_name} leaves team",
309
- channel: e.channel
310
- )
326
+ send_embedded_message(
327
+ description: "#{display_name} leaves team",
328
+ channel: e.channel
329
+ )
330
+ end
331
+ end
311
332
  end
312
333
  end
313
334
 
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.4.12
4
+ version: 5.4.13
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-11-01 00:00:00.000000000 Z
11
+ date: 2020-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: discordrb