qwtf_discord_bot 5.5.26 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/docker-compose.yml +1 -0
- data/lib/qwtf_discord_bot/qwtf_discord_bot_pug.rb +14 -7
- 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: 7873dfbc7828ca1970851e98c563be1adfc62cb0f451a4a3f76d5dbc551db8a4
|
4
|
+
data.tar.gz: b34b2f5138fff279ff9ed28f2034058cef15ba3cd95c4c4157d1588dd0664dc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bc88b6b480c2a53a8f79a17a1c7202d446d8a068aa1daf0bc9a685ca63c09705450466572ba3fb95a7b7e84360e7e29db41415a74f3e277ea08ae1e61c18b89
|
7
|
+
data.tar.gz: a75c8be77b08ffd148e79c374451e65d31f7b5131e6254f0fa2da434885db24a7ebb1df6e84509c3715a1f46cde7a53dae8d4a326fc367c996c791c81a3926ce
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
6.0.1
|
data/docker-compose.yml
CHANGED
@@ -430,7 +430,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
430
430
|
).body
|
431
431
|
|
432
432
|
send_embedded_message(
|
433
|
-
description: "#{TEAM_NAMES[winning_team_no]} wins game ##{id}. `!choose` again. [Ratings](
|
433
|
+
description: "#{TEAM_NAMES[winning_team_no]} wins game ##{id}. `!choose` again. [Ratings](#{discord_channel_leaderboard_url(e.channel.id)})",
|
434
434
|
channel: e.channel
|
435
435
|
)
|
436
436
|
end
|
@@ -498,7 +498,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
498
498
|
).body
|
499
499
|
|
500
500
|
send_embedded_message(
|
501
|
-
description: "Match ##{id} drawn. `!choose` again. [Ratings](
|
501
|
+
description: "Match ##{id} drawn. `!choose` again. [Ratings](#{discord_channel_leaderboard_url(e.channel.id)})",
|
502
502
|
channel: e.channel
|
503
503
|
)
|
504
504
|
end
|
@@ -694,7 +694,10 @@ class QwtfDiscordBotPug # :nodoc:
|
|
694
694
|
channel: event.channel
|
695
695
|
)
|
696
696
|
|
697
|
-
combinations = get_fair_teams(
|
697
|
+
combinations = get_fair_teams(
|
698
|
+
channel_id: event.channel.id, players: pug.joined_players
|
699
|
+
)
|
700
|
+
|
698
701
|
teams = combinations[iteration]
|
699
702
|
|
700
703
|
if !teams
|
@@ -814,7 +817,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
814
817
|
end
|
815
818
|
|
816
819
|
def post_results(json)
|
817
|
-
uri = URI(
|
820
|
+
uri = URI([ENV['RATINGS_API_URL'], 'matches'].join('/'))
|
818
821
|
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
819
822
|
req.body = json
|
820
823
|
|
@@ -823,9 +826,9 @@ class QwtfDiscordBotPug # :nodoc:
|
|
823
826
|
end
|
824
827
|
end
|
825
828
|
|
826
|
-
def get_fair_teams(players)
|
827
|
-
uri = URI(
|
828
|
-
params = { 'players[]' => players }
|
829
|
+
def get_fair_teams(channel_id:, players:)
|
830
|
+
uri = URI([ENV['RATINGS_API_URL'], 'fair_teams', 'new'].join('/'))
|
831
|
+
params = { :channel_id => channel_id, 'players[]' => players }
|
829
832
|
uri.query = URI.encode_www_form(params)
|
830
833
|
req = Net::HTTP::Get.new(uri)
|
831
834
|
|
@@ -839,4 +842,8 @@ class QwtfDiscordBotPug # :nodoc:
|
|
839
842
|
def ten_minutes_ago
|
840
843
|
Time.now.to_i - TEN_MINUTES
|
841
844
|
end
|
845
|
+
|
846
|
+
def discord_channel_leaderboard_url(channel_id)
|
847
|
+
[ENV['RATINGS_APP_URL'], "discord_channels", channel_id].join('/')
|
848
|
+
end
|
842
849
|
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:
|
4
|
+
version: 6.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sheldon Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: discordrb
|