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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef8bda609c0735d9ba3ba074c3f53a963c2d2cc7f933af4965ba9fb797b7d151
4
- data.tar.gz: de760869c4380aa7d14ec16b7828655b1534c41aa3808a6c26d8f36a5694e7dd
3
+ metadata.gz: 402ebf8fe6c235b94f6e1db48b228f13d0bdece3628873edf943f66f26c9d05c
4
+ data.tar.gz: 69c5fdad3c21f133a315a1f87ac9b92dc068efd13750e33f144bfdf64bf9ea8f
5
5
  SHA512:
6
- metadata.gz: ec8f53ff7b12188bab9059db811c478b7010a105e7d37e626816da5d03003502030515e7ab918b521ec0d6dd7998c1a776be332d8a1fdc1fa2a8935df4fb272b
7
- data.tar.gz: 4812904a6c1dd2824f08bd376239760c8506329438c26dae718ac809a123e6201547ad40f77de1bd3cab91781234022f6f914ba4f1abc21eba9c19c6f0e7999b
6
+ metadata.gz: fd4aa01e8a86d1e0e82b658c26e9f6bbfce16786e00c61bd6069c4be1a03a3a63ab8a05a497bb287cf861d8d0f37f210cf8f52510be5e812a47eba34f728d1a2
7
+ data.tar.gz: c2c25e668f9de93662ee2ddac5ac43d058c50d49be42647c1c1ec33046b10220cfcb1b3f5678b7d4a52899e99bad8092098f2159478b7435217de86263cea1c8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qwtf_discord_bot (6.1.3)
4
+ qwtf_discord_bot (6.1.4)
5
5
  discordrb (= 3.4.0)
6
6
  redis (~> 4.2)
7
7
  thor (~> 1.1)
@@ -93,4 +93,4 @@ DEPENDENCIES
93
93
  thor
94
94
 
95
95
  BUNDLED WITH
96
- 2.2.8
96
+ 2.2.21
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.1.3
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 |arg|
174
- unless arg.match(/<@!\d+>/)
174
+ args.each do |mention|
175
+ unless mention.match(VALID_MENTION)
175
176
  send_embedded_message(
176
- description: "#{arg} isn't a valid mention",
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(arg)
183
- display_name = e.display_name_for(user_id) || arg
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(/<@!\d+>/)
254
+ unless mention.match(VALID_MENTION)
254
255
  send_embedded_message(
255
- description: "#{arg} isn't a valid mention",
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) || arg
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(/<@!\d+>/)
314
+ unless mention.match(VALID_MENTION)
314
315
  send_embedded_message(
315
- description: "#{arg} isn't a valid mention",
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) || arg
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.3
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-25 00:00:00.000000000 Z
11
+ date: 2021-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: discordrb