qwtf_discord_bot 5.5.15 → 5.5.16
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 +4 -4
- data/VERSION +1 -1
- data/lib/qwtf_discord_bot/qwtf_discord_bot_pug.rb +7 -13
- 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: bb00493577fe32e4a2f0a73fd049bec1c195d08f710d559d3bc61f3c399f8e9a
|
|
4
|
+
data.tar.gz: b9fe1647ba8814b8f2d25c5dbcaacd8c52c930f891f27fdded26028dae2ee392
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 03be912e0aa6aa8a46f9edad585bb4512aa1f22cf78689faabb4be646ba99bffe50cc03cddaf88e308c4fb40893d3d8107431dc2da3c7b59a809cec500d68381
|
|
7
|
+
data.tar.gz: 73bd5b3b894f3e422d983f1295959cb6cd12f165d47f5ce9f86481e6ff6731226fdc9b909051d0d00df67c6b586fa124bd880d72d992ca2406a00c7e91a2bc40
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.5.
|
|
1
|
+
5.5.16
|
|
@@ -8,7 +8,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
|
8
8
|
|
|
9
9
|
MSG_SNIPPET_DELIMITER = ' · '
|
|
10
10
|
TEAM_NAMES = { 1 => "Blue", 2 => "Red" }
|
|
11
|
-
|
|
11
|
+
TEN_MINUTES = 10 * 60
|
|
12
12
|
|
|
13
13
|
def run
|
|
14
14
|
bot = Discordrb::Commands::CommandBot.new(
|
|
@@ -390,11 +390,9 @@ class QwtfDiscordBotPug # :nodoc:
|
|
|
390
390
|
)
|
|
391
391
|
end
|
|
392
392
|
|
|
393
|
-
if pug.last_result_time && pug.last_result_time >
|
|
394
|
-
time_ago = Time.now.to_i - pug.last_result_time
|
|
395
|
-
|
|
393
|
+
if pug.last_result_time && pug.last_result_time > ten_minutes_ago
|
|
396
394
|
return send_embedded_message(
|
|
397
|
-
description: "
|
|
395
|
+
description: "A match was reported less than 10 minutes ago",
|
|
398
396
|
channel: event.channel
|
|
399
397
|
)
|
|
400
398
|
end
|
|
@@ -431,8 +429,6 @@ class QwtfDiscordBotPug # :nodoc:
|
|
|
431
429
|
}.to_json
|
|
432
430
|
).body
|
|
433
431
|
|
|
434
|
-
pug.unteam_all_players
|
|
435
|
-
|
|
436
432
|
send_embedded_message(
|
|
437
433
|
description: "#{TEAM_NAMES[winning_team_no]} wins game ##{id}. `!choose` again. [Ratings](http://ratings.fortressone.org)",
|
|
438
434
|
channel: e.channel
|
|
@@ -470,11 +466,11 @@ class QwtfDiscordBotPug # :nodoc:
|
|
|
470
466
|
)
|
|
471
467
|
end
|
|
472
468
|
|
|
473
|
-
if pug.last_result_time && pug.last_result_time >
|
|
469
|
+
if pug.last_result_time && pug.last_result_time > ten_minutes_ago
|
|
474
470
|
time_ago = Time.now.to_i - pug.last_result_time
|
|
475
471
|
|
|
476
472
|
return send_embedded_message(
|
|
477
|
-
description: "
|
|
473
|
+
description: "A match was reported less than 10 minutes ago",
|
|
478
474
|
channel: event.channel
|
|
479
475
|
)
|
|
480
476
|
end
|
|
@@ -501,8 +497,6 @@ class QwtfDiscordBotPug # :nodoc:
|
|
|
501
497
|
}.to_json
|
|
502
498
|
).body
|
|
503
499
|
|
|
504
|
-
pug.unteam_all_players
|
|
505
|
-
|
|
506
500
|
send_embedded_message(
|
|
507
501
|
description: "Match ##{id} drawn. `!choose` again. [Ratings](http://ratings.fortressone.org)",
|
|
508
502
|
channel: e.channel
|
|
@@ -850,7 +844,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
|
850
844
|
JSON.parse(res.body).map(&:to_h)
|
|
851
845
|
end
|
|
852
846
|
|
|
853
|
-
def
|
|
854
|
-
Time.now.to_i -
|
|
847
|
+
def ten_minutes_ago
|
|
848
|
+
Time.now.to_i - TEN_MINUTES
|
|
855
849
|
end
|
|
856
850
|
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.5.
|
|
4
|
+
version: 5.5.16
|
|
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-12-
|
|
11
|
+
date: 2020-12-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: discordrb
|