commandrb 0.4.1 → 0.4.2
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/lib/commandrb.rb +26 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f29c156bce33643bcf6e96cf4e3412bb2f0c7491
|
4
|
+
data.tar.gz: '084fff7142244fd4b4d5de25c7f675a86f439816'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24f86e1110fa38f7424d85059635f6a0fb4d8c3ced1346ce398bc139c00a296dfa60f02b380ea9a87c719a3c7235163e0400bf63bc821efba10e2f0c39d825bb
|
7
|
+
data.tar.gz: c45ceb8987737e3a2a42698df5fb1354ccd12b3466d855d1fc91d01df8661b68020deb36396899bdae896d152632c13a4ef6065ebe3f16e6102aaf3b7485af41
|
data/lib/commandrb.rb
CHANGED
@@ -225,32 +225,42 @@ class CommandrbBot
|
|
225
225
|
code_error: false
|
226
226
|
)
|
227
227
|
)
|
228
|
+
@finished = true
|
228
229
|
break
|
229
230
|
end
|
230
231
|
end
|
231
232
|
|
232
|
-
# If the command is configured to catch all errors, thy shall be done.
|
233
|
-
if !command[:catch_errors] || @config['catch_errors']
|
234
|
-
# Run the command code!
|
235
|
-
command[:code].call(event, args, rawargs)
|
236
|
-
else
|
237
|
-
# Run the command code, but catch all errors and output accordingly.
|
238
|
-
begin
|
239
|
-
command[:code].call(event, args, rawargs)
|
240
|
-
rescue Exception => e
|
241
|
-
event.respond("❌ An error has occured!! ```ruby\n#{e}```Please contact the bot owner with the above message for assistance.")
|
242
|
-
end
|
243
|
-
end
|
244
|
-
|
245
233
|
unless command[:required_permissions].nil?
|
246
234
|
command[:required_permissions].each { |x|
|
247
|
-
|
248
|
-
event.
|
235
|
+
unless event.user.on(event.server).permission?(x,event.channel)
|
236
|
+
event.channel.send_message('', false,
|
237
|
+
Helper.error_embed(
|
238
|
+
error: "You don't have permission for that!\nPermission required: `#{x.to_s}`",
|
239
|
+
footer: "Command: `#{event.message.content}`",
|
240
|
+
colour: 0xFA0E30,
|
241
|
+
code_error: false
|
242
|
+
)
|
243
|
+
)
|
249
244
|
@finished = true
|
250
|
-
|
245
|
+
break
|
251
246
|
end
|
252
247
|
}
|
248
|
+
end
|
249
|
+
|
250
|
+
unless @finished
|
251
|
+
# If the command is configured to catch all errors, thy shall be done.
|
252
|
+
if !command[:catch_errors] || @config['catch_errors']
|
253
|
+
# Run the command code!
|
254
|
+
command[:code].call(event, args, rawargs)
|
255
|
+
else
|
256
|
+
# Run the command code, but catch all errors and output accordingly.
|
257
|
+
begin
|
258
|
+
command[:code].call(event, args, rawargs)
|
259
|
+
rescue Exception => e
|
260
|
+
event.respond("❌ An error has occured!! ```ruby\n#{e}```Please contact the bot owner with the above message for assistance.")
|
261
|
+
end
|
253
262
|
end
|
263
|
+
end
|
254
264
|
|
255
265
|
# All done here.
|
256
266
|
puts "Finished!! Executed command: #{@chosen}" if @debug_mode
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commandrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erisa Komuro (Seriel)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: discordrb
|