fix small typo
This commit is contained in:
parent
ff36de2446
commit
166fa8a6e1
|
@ -17,7 +17,7 @@ data class CustomCommand(
|
||||||
val timeout: Int = 20,
|
val timeout: Int = 20,
|
||||||
val defaultCommand: Boolean? = null,
|
val defaultCommand: Boolean? = null,
|
||||||
val execOp: Boolean? = null,
|
val execOp: Boolean? = null,
|
||||||
val argumentsRegext: Regex? = null
|
val argumentsRegex: Regex? = null
|
||||||
) : IBridgeCommand {
|
) : IBridgeCommand {
|
||||||
val alias: String
|
val alias: String
|
||||||
get() = BridgeCommandRegistry.getName(this)!!
|
get() = BridgeCommandRegistry.getName(this)!!
|
||||||
|
@ -26,9 +26,9 @@ data class CustomCommand(
|
||||||
private var lastUsed: Int = 0
|
private var lastUsed: Int = 0
|
||||||
|
|
||||||
override fun execute(alias: String, user: String, userId: String, server: String, args: String): Boolean {
|
override fun execute(alias: String, user: String, userId: String, server: String, args: String): Boolean {
|
||||||
if(argumentsRegext != null) {
|
if(argumentsRegex != null) {
|
||||||
instance.debug("testing '$args' against '${argumentsRegext.pattern}'")
|
instance.debug("testing '$args' against '${argumentsRegex.pattern}'")
|
||||||
if(!argumentsRegext.matches(args)) {
|
if(!argumentsRegex.matches(args)) {
|
||||||
MessageHandlerInst.transmit(
|
MessageHandlerInst.transmit(
|
||||||
ApiMessage(
|
ApiMessage(
|
||||||
text = "$user sent invalid input to command $alias".stripColorOut
|
text = "$user sent invalid input to command $alias".stripColorOut
|
||||||
|
|
|
@ -58,7 +58,7 @@ object CommandConfig {
|
||||||
"exec" to CustomCommand(
|
"exec" to CustomCommand(
|
||||||
type = CommandType.EXECUTE,
|
type = CommandType.EXECUTE,
|
||||||
execute = "{args}",
|
execute = "{args}",
|
||||||
argumentsRegext = ".*".toRegex(),
|
argumentsRegex = ".*".toRegex(),
|
||||||
permLevel = 1.0,
|
permLevel = 1.0,
|
||||||
help = "Execute any command as OP, be careful with this one",
|
help = "Execute any command as OP, be careful with this one",
|
||||||
execOp = true,
|
execOp = true,
|
||||||
|
|
Loading…
Reference in New Issue