qwtf_discord_bot 6.1.3 → 6.1.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/Gemfile.lock +2 -2
- data/VERSION +1 -1
- data/lib/qwtf_discord_bot/qwtf_discord_bot_pug.rb +12 -11
- 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: 402ebf8fe6c235b94f6e1db48b228f13d0bdece3628873edf943f66f26c9d05c
|
|
4
|
+
data.tar.gz: 69c5fdad3c21f133a315a1f87ac9b92dc068efd13750e33f144bfdf64bf9ea8f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd4aa01e8a86d1e0e82b658c26e9f6bbfce16786e00c61bd6069c4be1a03a3a63ab8a05a497bb287cf861d8d0f37f210cf8f52510be5e812a47eba34f728d1a2
|
|
7
|
+
data.tar.gz: c2c25e668f9de93662ee2ddac5ac43d058c50d49be42647c1c1ec33046b10220cfcb1b3f5678b7d4a52899e99bad8092098f2159478b7435217de86263cea1c8
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.1.
|
|
1
|
+
6.1.4
|
|
@@ -9,6 +9,7 @@ class QwtfDiscordBotPug # :nodoc:
|
|
|
9
9
|
MSG_SNIPPET_DELIMITER = ' · '
|
|
10
10
|
TEAM_NAMES = { 1 => "Blue", 2 => "Red" }
|
|
11
11
|
TEN_MINUTES = 10 * 60
|
|
12
|
+
VALID_MENTION = /<@!?\d+>/
|
|
12
13
|
|
|
13
14
|
def run
|
|
14
15
|
bot = Discordrb::Commands::CommandBot.new(
|
|
@@ -170,17 +171,17 @@ class QwtfDiscordBotPug # :nodoc:
|
|
|
170
171
|
)
|
|
171
172
|
end
|
|
172
173
|
|
|
173
|
-
args.each do |
|
|
174
|
-
unless
|
|
174
|
+
args.each do |mention|
|
|
175
|
+
unless mention.match(VALID_MENTION)
|
|
175
176
|
send_embedded_message(
|
|
176
|
-
description: "#{
|
|
177
|
+
description: "#{mention} isn't a valid mention",
|
|
177
178
|
channel: e.channel
|
|
178
179
|
)
|
|
179
180
|
next
|
|
180
181
|
end
|
|
181
182
|
|
|
182
|
-
user_id = mention_to_user_id(
|
|
183
|
-
display_name = e.display_name_for(user_id) ||
|
|
183
|
+
user_id = mention_to_user_id(mention)
|
|
184
|
+
display_name = e.display_name_for(user_id) || mention
|
|
184
185
|
|
|
185
186
|
unless pug.joined?(user_id)
|
|
186
187
|
send_embedded_message(
|
|
@@ -250,16 +251,16 @@ class QwtfDiscordBotPug # :nodoc:
|
|
|
250
251
|
)
|
|
251
252
|
else
|
|
252
253
|
args[1..-1].each do |mention|
|
|
253
|
-
unless mention.match(
|
|
254
|
+
unless mention.match(VALID_MENTION)
|
|
254
255
|
send_embedded_message(
|
|
255
|
-
description: "#{
|
|
256
|
+
description: "#{mention} isn't a valid mention",
|
|
256
257
|
channel: e.channel
|
|
257
258
|
)
|
|
258
259
|
next
|
|
259
260
|
end
|
|
260
261
|
|
|
261
262
|
user_id = mention_to_user_id(mention)
|
|
262
|
-
display_name = e.display_name_for(user_id) ||
|
|
263
|
+
display_name = e.display_name_for(user_id) || mention
|
|
263
264
|
pug.join_team(team_no: team_no, player_id: user_id)
|
|
264
265
|
|
|
265
266
|
send_embedded_message(
|
|
@@ -310,16 +311,16 @@ class QwtfDiscordBotPug # :nodoc:
|
|
|
310
311
|
)
|
|
311
312
|
else
|
|
312
313
|
args.each do |mention|
|
|
313
|
-
unless mention.match(
|
|
314
|
+
unless mention.match(VALID_MENTION)
|
|
314
315
|
send_embedded_message(
|
|
315
|
-
description: "#{
|
|
316
|
+
description: "#{mention} isn't a valid mention",
|
|
316
317
|
channel: e.channel
|
|
317
318
|
)
|
|
318
319
|
next
|
|
319
320
|
end
|
|
320
321
|
|
|
321
322
|
user_id = mention_to_user_id(mention)
|
|
322
|
-
display_name = e.display_name_for(user_id) ||
|
|
323
|
+
display_name = e.display_name_for(user_id) || mention
|
|
323
324
|
|
|
324
325
|
unless pug.joined?(user_id)
|
|
325
326
|
return send_embedded_message(
|
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: 6.1.
|
|
4
|
+
version: 6.1.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: 2021-06-
|
|
11
|
+
date: 2021-06-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: discordrb
|