qwtf_discord_bot 5.1.4 → 5.1.5

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: 2764268ae2786e3217f973d14b910bbed79dd4b1d4b822ebaee31b4f555c9945
4
- data.tar.gz: ec2f3fd80b0eaaa222ca9cac071763ef3220190991f94e37a112025002b76cec
3
+ metadata.gz: d0adf9bb170277ec37dddc27d86049f6d678ddbb3b69530b114a177f11719d21
4
+ data.tar.gz: ff6c28db3deb0fad59b2ca45d4d53b3c45c622848cc15d6234d14b245c865413
5
5
  SHA512:
6
- metadata.gz: 7d86a1207ec73b9225c0a72d530000a6e7ce3297e490bbb914dd45f181be7b1a214c67242b35274545c1f92c4d11911c42e5b6434fc5ecc1dddae33303bfff72
7
- data.tar.gz: b654a7a3c136c4847dd9aefc0f4e7e695b7f7dc4a8a8ad521535096d10385c17397f2324bb0a65393da99207934f719523b00a9a1754dd76a368d5bd0001ce75
6
+ metadata.gz: 5dfb62990d27a5f250ea4ddbbe5f62583618e947c2c26d8df85308e2b99bb204a35a2b25347080a2352d4d1a7508e45e690fd7a636cd7e7baf1fc2305d8c9a60
7
+ data.tar.gz: 52590b32e2c4727c7ccd9b526bdc9f8abccb46b8d4e815d78cd7eb3cfd7dea669e57890b171dfdeb41c5a9de092d38147ae0b3469a97bb1450f96e713fe9b27a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.1.4
1
+ 5.1.5
@@ -118,6 +118,32 @@ class QwtfDiscordBotPug # :nodoc:
118
118
  end
119
119
  end
120
120
 
121
+ bot.command :kick do |event, *args|
122
+ set_pug(event) do |e, pug|
123
+ if !pug.active?
124
+ message = "There's no active PUG"
125
+ return send_and_log_message(message, e.channel)
126
+ end
127
+
128
+ mention = args[0]
129
+ user_id = mention[3..-2].to_i
130
+
131
+ if !pug.joined_players.include?(user_id)
132
+ message = "#{mention} isn't in the PUG"
133
+ send_and_log_message(message, e.channel)
134
+ else
135
+ pug.leave(user_id)
136
+ message = "#{e.display_name} is kicked from the PUG | #{pug.player_slots} remain"
137
+ send_and_log_message(message, e.channel)
138
+
139
+ if pug.empty?
140
+ message = end_pug(pug)
141
+ send_and_log_message(message, e.channel)
142
+ end
143
+ end
144
+ end
145
+ end
146
+
121
147
  bot.command :end do |event, *args|
122
148
  set_pug(event) do |e, pug|
123
149
  message = if !pug.active?
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.1.4
4
+ version: 5.1.5
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-08-25 00:00:00.000000000 Z
11
+ date: 2020-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: discordrb