qwtf_discord_bot 5.3.7 → 5.4.4
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/pug.rb +5 -3
- data/lib/qwtf_discord_bot/qwtf_discord_bot_pug.rb +140 -112
- 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: 81a6cd600bd16f113cbfd1a44b05a5d362428c5f31e3bc3a1310fc243cbb14d7
|
4
|
+
data.tar.gz: 0da538524b5ad76d74ce7eaf380331769759e540ffc80719d784abea9d0789eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c349a08aaeb38a0dee3448fe0f57307dd20d17b71ff6dbae4e6a1da2d4c6198c13ed04ca560386013fcc89cafa7d584a5f5388b965594d6e8879c71d86efdc4
|
7
|
+
data.tar.gz: 73e8b9482f07568f16fc3c1100103aa2679e84f4cf656d163bb0f5dc7d51259b8d422498b7dfcef2c62fca5f093b8a6981814dae956da0d5bd49eae044e076b1
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.
|
1
|
+
5.4.4
|
data/lib/pug.rb
CHANGED
@@ -122,13 +122,15 @@ class Pug
|
|
122
122
|
end
|
123
123
|
|
124
124
|
def teams
|
125
|
-
teams_keys.inject({}) do |teams, team|
|
126
|
-
teams.merge({ team.split(':').last => redis.smembers(team).map(&:to_i) })
|
125
|
+
all_teams = teams_keys.inject({}) do |teams, team|
|
126
|
+
teams.merge({ team.split(':').last.to_i => redis.smembers(team).map(&:to_i) })
|
127
127
|
end
|
128
|
+
|
129
|
+
all_teams.sort.to_h
|
128
130
|
end
|
129
131
|
|
130
132
|
def actual_teams
|
131
|
-
teams.tap { |team| team.delete(
|
133
|
+
teams.tap { |team| team.delete(0) }
|
132
134
|
end
|
133
135
|
|
134
136
|
private
|
@@ -7,13 +7,22 @@ class QwtfDiscordBotPug # :nodoc:
|
|
7
7
|
include QwtfDiscordBot
|
8
8
|
|
9
9
|
MSG_SNIPPET_DELIMITER = ' · '
|
10
|
+
TEAM_NAMES = { 0 => "No team", 1 => "Blue", 2 => "Red" }
|
10
11
|
|
11
12
|
def run
|
12
13
|
bot = Discordrb::Commands::CommandBot.new(
|
13
14
|
token: QwtfDiscordBot.config.token,
|
14
15
|
client_id: QwtfDiscordBot.config.client_id,
|
15
16
|
help_command: false,
|
16
|
-
prefix:
|
17
|
+
prefix: proc do |message|
|
18
|
+
match = /^\!(\w+)(.*)/.match(message.content)
|
19
|
+
if match
|
20
|
+
first = match[1]
|
21
|
+
rest = match[2]
|
22
|
+
# Return the modified string with the first word lowercase:
|
23
|
+
"#{first.downcase}#{rest}"
|
24
|
+
end
|
25
|
+
end
|
17
26
|
)
|
18
27
|
|
19
28
|
bot.command :help do |event, *args|
|
@@ -22,7 +31,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
22
31
|
|
23
32
|
bot.command :join do |event, *args|
|
24
33
|
setup_pug(event) do |e, pug|
|
25
|
-
return
|
34
|
+
return send_embedded_message("You've already joined", e.channel) if pug.joined?(e.user_id)
|
26
35
|
|
27
36
|
join_pug(e, pug)
|
28
37
|
start_pug(pug, e) if pug.full?
|
@@ -31,30 +40,48 @@ class QwtfDiscordBotPug # :nodoc:
|
|
31
40
|
|
32
41
|
bot.command :status do |event, *args|
|
33
42
|
setup_pug(event) do |e, pug|
|
34
|
-
return
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
43
|
+
return send_embedded_message('No PUG has been started. `!join` to create', e.channel) unless pug.active?
|
44
|
+
|
45
|
+
footer = [
|
46
|
+
pug.game_map,
|
47
|
+
"#{pug.player_slots} joined",
|
48
|
+
].compact.join(MSG_SNIPPET_DELIMITER)
|
49
|
+
|
50
|
+
send_embedded_message(nil, e.channel) do |embed|
|
51
|
+
embed.footer = Discordrb::Webhooks::EmbedFooter.new(
|
52
|
+
text: footer
|
53
|
+
)
|
54
|
+
|
55
|
+
pug.teams.each do |team_no, player_ids|
|
56
|
+
team_display_names = player_ids.map do |player_id|
|
57
|
+
e.display_name_for(player_id)
|
58
|
+
end
|
59
|
+
|
60
|
+
embed.add_field(
|
61
|
+
Discordrb::Webhooks::EmbedField.new(
|
62
|
+
{
|
63
|
+
inline: true,
|
64
|
+
name: team_name(team_no),
|
65
|
+
value: team_display_names.join("\n")
|
66
|
+
}
|
67
|
+
)
|
68
|
+
)
|
69
|
+
end
|
70
|
+
end
|
44
71
|
end
|
45
72
|
end
|
46
73
|
|
47
74
|
bot.command :teamsize do |event, *args|
|
48
75
|
setup_pug(event) do |e, pug|
|
49
|
-
return
|
76
|
+
return send_embedded_message("Team size is #{pug.teamsize}", e.channel) unless args.any?
|
50
77
|
|
51
78
|
new_teamsize = args[0].to_i
|
52
|
-
return
|
79
|
+
return send_embedded_message('Team size should be a number higher than 0', e.channel) unless new_teamsize > 0
|
53
80
|
|
54
81
|
if new_teamsize
|
55
82
|
pug.teamsize = new_teamsize
|
56
83
|
|
57
|
-
|
84
|
+
send_embedded_message(
|
58
85
|
[
|
59
86
|
"Team size set to #{pug.teamsize}",
|
60
87
|
"#{pug.player_slots} joined"
|
@@ -64,7 +91,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
64
91
|
|
65
92
|
start_pug(pug, e) if pug.full?
|
66
93
|
else
|
67
|
-
|
94
|
+
send_embedded_message(
|
68
95
|
[
|
69
96
|
"Current team size is #{pug.teamsize}",
|
70
97
|
"#{pug.player_slots} joined"
|
@@ -77,8 +104,8 @@ class QwtfDiscordBotPug # :nodoc:
|
|
77
104
|
|
78
105
|
bot.command :leave do |event, *args|
|
79
106
|
setup_pug(event) do |e, pug|
|
80
|
-
return
|
81
|
-
return
|
107
|
+
return send_embedded_message(no_active_pug_message, e.channel) unless pug.active?
|
108
|
+
return send_embedded_message("You're not in the PUG", e.channel) unless pug.joined?(e.user_id)
|
82
109
|
|
83
110
|
pug.leave(e.user_id)
|
84
111
|
|
@@ -89,7 +116,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
89
116
|
|
90
117
|
snippets << "#{pug.slots_left} more #{pug.notify_roles}" if pug.slots_left == 1
|
91
118
|
|
92
|
-
|
119
|
+
send_embedded_message(
|
93
120
|
snippets.join(MSG_SNIPPET_DELIMITER),
|
94
121
|
e.channel
|
95
122
|
)
|
@@ -100,12 +127,12 @@ class QwtfDiscordBotPug # :nodoc:
|
|
100
127
|
|
101
128
|
bot.command :kick do |event, *args|
|
102
129
|
setup_pug(event) do |e, pug|
|
103
|
-
return
|
104
|
-
return
|
130
|
+
return send_embedded_message("Kick who? e.g. `!kick @#{e.display_name}`", e.channel) unless args.any?
|
131
|
+
return send_embedded_message(no_active_pug_message, e.channel) unless pug.active?
|
105
132
|
|
106
133
|
args.each do |arg|
|
107
134
|
unless arg.match(/<@!\d+>/)
|
108
|
-
|
135
|
+
send_embedded_message("#{arg} isn't a valid mention", e.channel)
|
109
136
|
next
|
110
137
|
end
|
111
138
|
|
@@ -113,7 +140,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
113
140
|
display_name = e.display_name_for(user_id) || arg
|
114
141
|
|
115
142
|
unless pug.joined?(user_id)
|
116
|
-
|
143
|
+
send_embedded_message("#{display_name} isn't in the PUG", e.channel)
|
117
144
|
next
|
118
145
|
end
|
119
146
|
|
@@ -126,7 +153,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
126
153
|
|
127
154
|
snippets << "#{pug.slots_left} more #{pug.notify_roles}" if pug.slots_left == 1
|
128
155
|
|
129
|
-
|
156
|
+
send_embedded_message(
|
130
157
|
snippets.join(MSG_SNIPPET_DELIMITER),
|
131
158
|
e.channel
|
132
159
|
)
|
@@ -138,30 +165,29 @@ class QwtfDiscordBotPug # :nodoc:
|
|
138
165
|
|
139
166
|
bot.command :team do |event, *args|
|
140
167
|
setup_pug(event) do |e, pug|
|
141
|
-
return
|
142
|
-
|
143
|
-
team_no = args[0].to_i
|
144
|
-
return send_msg("Choose a team between 0 and 4", e.channel) unless team_no.between?(0, 4)
|
168
|
+
return send_embedded_message("Which team? E.G. `!team 1`", e.channel) unless args.any?
|
169
|
+
return send_embedded_message("Choose a team between 0 and 2", e.channel) unless ["0", "1", "2"].any?(args.first)
|
145
170
|
|
171
|
+
team_no = args.first.to_i
|
146
172
|
pug_already_full = pug.full?
|
147
173
|
|
148
174
|
if args.count == 1
|
149
175
|
user_id = e.user_id
|
150
|
-
return
|
176
|
+
return send_embedded_message("You're already in #{TEAM_NAMES[team_no]}", e.channel) if pug.team(team_no).include?(user_id)
|
151
177
|
|
152
178
|
join_pug(e, pug) unless pug.joined?(user_id)
|
153
179
|
pug.join_team(team_no: team_no, player_id: user_id)
|
154
180
|
|
155
|
-
|
181
|
+
send_embedded_message(
|
156
182
|
[
|
157
|
-
"#{e.display_name} joins
|
183
|
+
"#{e.display_name} joins #{TEAM_NAMES[team_no]}",
|
158
184
|
"#{pug.team_player_count(team_no)}/#{pug.teamsize}"
|
159
185
|
].join(MSG_SNIPPET_DELIMITER), e.channel
|
160
186
|
)
|
161
187
|
else
|
162
188
|
args[1..-1].each do |mention|
|
163
189
|
unless mention.match(/<@!\d+>/)
|
164
|
-
|
190
|
+
send_embedded_message("#{arg} isn't a valid mention", e.channel)
|
165
191
|
next
|
166
192
|
end
|
167
193
|
|
@@ -169,15 +195,15 @@ class QwtfDiscordBotPug # :nodoc:
|
|
169
195
|
display_name = e.display_name_for(user_id) || arg
|
170
196
|
|
171
197
|
unless pug.joined?(user_id)
|
172
|
-
|
198
|
+
send_embedded_message("#{display_name} isn't in the PUG", e.channel)
|
173
199
|
next
|
174
200
|
end
|
175
201
|
|
176
202
|
pug.join_team(team_no: team_no, player_id: user_id)
|
177
203
|
|
178
|
-
|
204
|
+
send_embedded_message(
|
179
205
|
[
|
180
|
-
"#{display_name} joins
|
206
|
+
"#{display_name} joins #{TEAM_NAMES[team_no]}",
|
181
207
|
"#{pug.team_player_count(team_no)}/#{pug.teamsize}"
|
182
208
|
].join(MSG_SNIPPET_DELIMITER), e.channel
|
183
209
|
)
|
@@ -191,25 +217,25 @@ class QwtfDiscordBotPug # :nodoc:
|
|
191
217
|
bot.command :unteam do |event, *args|
|
192
218
|
setup_pug(event) do |e, pug|
|
193
219
|
user_id = e.user_id
|
194
|
-
return
|
195
|
-
return
|
196
|
-
return
|
220
|
+
return send_embedded_message('No PUG has been started. `!join` to create', e.channel) unless pug.active?
|
221
|
+
return send_embedded_message("You aren't in this PUG", e.channel) unless pug.joined?(user_id)
|
222
|
+
return send_embedded_message("You aren't in a team", e.channel) if pug.team(0).include?(user_id)
|
197
223
|
|
198
224
|
pug.join_team(team_no: 0, player_id: user_id)
|
199
|
-
|
225
|
+
send_embedded_message("#{e.display_name} has no team", e.channel)
|
200
226
|
end
|
201
227
|
end
|
202
228
|
|
203
229
|
bot.command :win do |event, *args|
|
204
230
|
setup_pug(event) do |e, pug|
|
205
|
-
return
|
231
|
+
return send_embedded_message(no_active_pug_message, e.channel) unless pug.active?
|
232
|
+
return send_embedded_message("Specify winning team; e.g. `!win 1`", e.channel) unless args.any?
|
233
|
+
return send_embedded_message("Invalid team number", e.channel) unless ["1", "2"].any?(args.first)
|
206
234
|
|
207
|
-
winning_team_no = args
|
208
|
-
|
209
|
-
return send_msg("Not a valid team", e.channel) unless pug.team(winning_team_no).any?
|
235
|
+
winning_team_no = args.first.to_i
|
210
236
|
|
211
237
|
if pug.actual_teams.count < 2
|
212
|
-
return
|
238
|
+
return send_embedded_message(
|
213
239
|
"There must be at least two teams with players to submit a result", e.channel
|
214
240
|
)
|
215
241
|
end
|
@@ -236,26 +262,16 @@ class QwtfDiscordBotPug # :nodoc:
|
|
236
262
|
}.to_json
|
237
263
|
)
|
238
264
|
|
239
|
-
#
|
240
|
-
# e.display_name_for(player_id)
|
241
|
-
# end
|
242
|
-
|
243
|
-
# non_winning_teams = pug.actual_teams.tap { |team| team.delete(winning_team_no) }
|
244
|
-
|
245
|
-
# losing_players = non_winning_teams.values.flatten.map do |player_id|
|
246
|
-
# e.display_name_for(player_id)
|
247
|
-
# end
|
248
|
-
|
249
|
-
send_msg("Team #{winning_team_no} wins", e.channel)
|
265
|
+
send_embedded_message("#{TEAM_NAMES[winning_team_no]} wins. [Ratings](http://ratings.fortressone.org)", e.channel)
|
250
266
|
end
|
251
267
|
end
|
252
268
|
|
253
269
|
bot.command :draw do |event, *args|
|
254
270
|
setup_pug(event) do |e, pug|
|
255
|
-
return
|
271
|
+
return send_embedded_message(no_active_pug_message, e.channel) unless pug.active?
|
256
272
|
|
257
273
|
if pug.actual_teams.count < 2
|
258
|
-
return
|
274
|
+
return send_embedded_message(
|
259
275
|
"There must be at least two teams with players to submit a result", e.channel
|
260
276
|
)
|
261
277
|
end
|
@@ -281,13 +297,13 @@ class QwtfDiscordBotPug # :nodoc:
|
|
281
297
|
}.to_json
|
282
298
|
)
|
283
299
|
|
284
|
-
|
300
|
+
send_embedded_message("Match drawn. [Ratings](http://ratings.fortressone.org)", e.channel)
|
285
301
|
end
|
286
302
|
end
|
287
303
|
|
288
304
|
bot.command :end do |event, *args|
|
289
305
|
setup_pug(event) do |e, pug|
|
290
|
-
return
|
306
|
+
return send_embedded_message(no_active_pug_message, e.channel) unless pug.active?
|
291
307
|
|
292
308
|
end_pug(pug, e.channel)
|
293
309
|
end
|
@@ -296,47 +312,47 @@ class QwtfDiscordBotPug # :nodoc:
|
|
296
312
|
bot.command :addmap do |event, *args|
|
297
313
|
setup_pug(event) do |e, pug|
|
298
314
|
maps = args
|
299
|
-
return
|
315
|
+
return send_embedded_message("What map? e.g. `!addmap 2fort5r`", e.channel) unless maps.any?
|
300
316
|
|
301
317
|
pug.add_maps(maps)
|
302
|
-
|
318
|
+
send_embedded_message("#{maps.join(', ')} added to maps", e.channel)
|
303
319
|
end
|
304
320
|
end
|
305
321
|
|
306
322
|
bot.command :removemap do |event, *args|
|
307
323
|
setup_pug(event) do |e, pug|
|
308
324
|
maps = args
|
309
|
-
return
|
325
|
+
return send_embedded_message("What map? e.g. `!removemap 2fort5r`", e.channel) unless maps.any?
|
310
326
|
|
311
327
|
pug.remove_maps(maps)
|
312
|
-
|
328
|
+
send_embedded_message("#{maps.join(', ')} removed from maps", e.channel)
|
313
329
|
end
|
314
330
|
end
|
315
331
|
|
316
332
|
bot.command :maps do |event, *args|
|
317
333
|
setup_pug(event) do |e, pug|
|
318
334
|
maps = pug.maps
|
319
|
-
return
|
335
|
+
return send_embedded_message('No maps have been added. `!addmap`', e.channel) unless maps.any?
|
320
336
|
|
321
|
-
|
337
|
+
send_embedded_message(maps.join(', '), e.channel)
|
322
338
|
end
|
323
339
|
end
|
324
340
|
|
325
341
|
bot.command :map do |event, *args|
|
326
342
|
setup_pug(event) do |e, pug|
|
327
343
|
maps = pug.maps
|
328
|
-
return
|
329
|
-
return
|
344
|
+
return send_embedded_message('No maps have been added. `!addmap`', e.channel) unless maps.any?
|
345
|
+
return send_embedded_message(no_active_pug_message, e.channel) unless pug.active?
|
330
346
|
|
331
347
|
if args.empty?
|
332
|
-
return
|
333
|
-
|
348
|
+
return send_embedded_message('No map has been set for the current PUG', e.channel) unless pug.game_map
|
349
|
+
send_embedded_message("Current map is #{pug.game_map}", e.channel)
|
334
350
|
else
|
335
351
|
game_map = args.first
|
336
|
-
return
|
352
|
+
return send_embedded_message("#{game_map} isn't in the map list. `!addmap` to add it.", e.channel) unless maps.include?(game_map)
|
337
353
|
|
338
354
|
pug.game_map = game_map
|
339
|
-
|
355
|
+
send_embedded_message("Map set to #{game_map}", e.channel)
|
340
356
|
end
|
341
357
|
end
|
342
358
|
end
|
@@ -352,7 +368,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
352
368
|
"Notification role set to #{roles}"
|
353
369
|
end
|
354
370
|
|
355
|
-
|
371
|
+
send_embedded_message(msg, e.channel)
|
356
372
|
end
|
357
373
|
end
|
358
374
|
|
@@ -361,6 +377,10 @@ class QwtfDiscordBotPug # :nodoc:
|
|
361
377
|
|
362
378
|
private
|
363
379
|
|
380
|
+
def team_name(team_no)
|
381
|
+
[team_no, TEAM_NAMES[team_no]].join(" ")
|
382
|
+
end
|
383
|
+
|
364
384
|
def mention_to_user_id(mention)
|
365
385
|
mention[3..-2].to_i
|
366
386
|
end
|
@@ -375,7 +395,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
375
395
|
snippets << "#{pug.slots_left} more #{pug.notify_roles}" if pug.slots_left.between?(1, 3)
|
376
396
|
end
|
377
397
|
|
378
|
-
|
398
|
+
send_embedded_message(snippets.join(MSG_SNIPPET_DELIMITER), e.channel)
|
379
399
|
end
|
380
400
|
|
381
401
|
def setup_pug(event)
|
@@ -386,62 +406,59 @@ class QwtfDiscordBotPug # :nodoc:
|
|
386
406
|
end
|
387
407
|
|
388
408
|
def start_pug(pug, event)
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
end
|
409
|
+
if !pug.actual_teams.any?
|
410
|
+
send_embedded_message("Choosing fair teams...", event.channel)
|
411
|
+
teams = get_fair_teams(pug.joined_players)
|
393
412
|
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
413
|
+
teams.each do |team_no, player_ids|
|
414
|
+
player_ids.each do |player_id|
|
415
|
+
pug.join_team(team_no: team_no, player_id: player_id)
|
416
|
+
end
|
417
|
+
end
|
399
418
|
end
|
400
419
|
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
].join(
|
405
|
-
|
406
|
-
send_msg(msg, event.channel)
|
407
|
-
end
|
408
|
-
|
409
|
-
def pug_teams_message(pug, event)
|
410
|
-
pug.teams.map do |team_no, player_ids|
|
411
|
-
team_display_names = player_ids.map do |player_id|
|
412
|
-
event.display_name_for(player_id)
|
413
|
-
end
|
420
|
+
footer = [
|
421
|
+
pug.game_map,
|
422
|
+
"#{pug.player_slots} joined",
|
423
|
+
].compact.join(MSG_SNIPPET_DELIMITER)
|
414
424
|
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
teamsize: pug.teamsize
|
425
|
+
send_embedded_message("Time to play!", event.channel) do |embed|
|
426
|
+
embed.footer = Discordrb::Webhooks::EmbedFooter.new(
|
427
|
+
text: footer
|
419
428
|
)
|
420
|
-
end
|
421
|
-
end
|
422
429
|
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
430
|
+
pug.teams.each do |team_no, player_ids|
|
431
|
+
team_mentions = player_ids.map do |player_id|
|
432
|
+
event.mention_for(player_id)
|
433
|
+
end
|
434
|
+
|
435
|
+
embed.add_field(
|
436
|
+
Discordrb::Webhooks::EmbedField.new(
|
437
|
+
{
|
438
|
+
inline: true,
|
439
|
+
name: team_name(team_no),
|
440
|
+
value: team_mentions.join("\n")
|
441
|
+
}
|
442
|
+
)
|
443
|
+
)
|
444
|
+
end
|
431
445
|
end
|
432
446
|
end
|
433
447
|
|
434
448
|
def end_pug(pug, channel_id)
|
435
449
|
pug.end_pug
|
436
|
-
|
450
|
+
send_embedded_message('PUG ended', channel_id)
|
437
451
|
end
|
438
452
|
|
439
453
|
def no_active_pug_message
|
440
454
|
"There's no active PUG"
|
441
455
|
end
|
442
456
|
|
443
|
-
def
|
444
|
-
|
457
|
+
def send_embedded_message(message, channel)
|
458
|
+
embed = Discordrb::Webhooks::Embed.new
|
459
|
+
embed.description = message
|
460
|
+
yield(embed) if block_given?
|
461
|
+
channel.send_embed(nil, embed) && puts(message)
|
445
462
|
end
|
446
463
|
|
447
464
|
def post_results(json)
|
@@ -452,4 +469,15 @@ class QwtfDiscordBotPug # :nodoc:
|
|
452
469
|
http.request(req)
|
453
470
|
end
|
454
471
|
end
|
472
|
+
|
473
|
+
def get_fair_teams(players)
|
474
|
+
uri = URI("#{ENV['RATINGS_API_URL']}fair_teams/new")
|
475
|
+
params = { 'players[]' => players }
|
476
|
+
uri.query = URI.encode_www_form(params)
|
477
|
+
req = Net::HTTP::Get.new(uri)
|
478
|
+
res = Net::HTTP.start(uri.hostname, uri.port) do |http|
|
479
|
+
http.request(req)
|
480
|
+
end
|
481
|
+
JSON.parse(res.body).first.to_h
|
482
|
+
end
|
455
483
|
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.
|
4
|
+
version: 5.4.4
|
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-10-
|
11
|
+
date: 2020-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: discordrb
|