File tree 1 file changed +15
-7
lines changed
src/main/kotlin/com/mrkirby153/botcore/command/slashcommand/dsl
1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -296,10 +296,12 @@ class DslCommandExecutor private constructor(
296
296
if (slashCommand != null ) {
297
297
scope.launch {
298
298
log.trace(" Running command ${slashCommand.name} with a timeout of ${slashCommand.timeout} " )
299
- withTimeout(slashCommand.timeout) {
299
+ if (slashCommand.timeout != 0L )
300
+ withTimeout(slashCommand.timeout) {
301
+ execute(event, this )
302
+ }
303
+ else
300
304
execute(event, this )
301
- }
302
-
303
305
}
304
306
}
305
307
}
@@ -320,9 +322,12 @@ class DslCommandExecutor private constructor(
320
322
scope.launch {
321
323
userContextCommands.firstOrNull { it.name == event.name }
322
324
?.apply {
323
- withTimeout(timeout) {
325
+ if (timeout != 0L )
326
+ withTimeout(timeout) {
327
+ execute(UserContext (event, scope))
328
+ }
329
+ else
324
330
execute(UserContext (event, scope))
325
- }
326
331
}
327
332
}
328
333
}
@@ -331,9 +336,12 @@ class DslCommandExecutor private constructor(
331
336
scope.launch {
332
337
messageContextCommands.firstOrNull { it.name == event.name }
333
338
?.apply {
334
- withTimeout(timeout) {
339
+ if (timeout != 0L )
340
+ withTimeout(timeout) {
341
+ execute(MessageContext (event, scope))
342
+ }
343
+ else
335
344
execute(MessageContext (event, scope))
336
- }
337
345
}
338
346
}
339
347
}
You can’t perform that action at this time.
0 commit comments