Skip to content

Commit 6bee3eb

Browse files
committed
search, suggest, and fill by command name too
1 parent ad54aff commit 6bee3eb

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

common/src/main/kotlin/com/lambda/command/commands/ConfigCommand.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ import com.lambda.command.LambdaCommand
2828
import com.lambda.config.Configuration
2929
import com.lambda.util.Communication.info
3030
import com.lambda.util.extension.CommandBuilder
31-
import com.lambda.util.text.buildText
32-
import com.lambda.util.text.highlighted
33-
import com.lambda.util.text.literal
3431

3532
object ConfigCommand : LambdaCommand(
3633
name = "config",
@@ -69,7 +66,7 @@ object ConfigCommand : LambdaCommand(
6966
required(string("setting")) { setting ->
7067
suggests { ctx, builder ->
7168
val conf = config(ctx).value()
72-
Configuration.configurableByName(conf)?.let { configurable ->
69+
Configuration.configurableByCommandName(conf)?.let { configurable ->
7370
configurable.settings.forEach {
7471
builder.suggest(it.commandName)
7572
}

common/src/main/kotlin/com/lambda/command/commands/ModuleCommand.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ object ModuleCommand : LambdaCommand(
6363
literal("Enabled Modules: ")
6464
}
6565
joinToText(enabled) {
66-
clickEvent(suggestCommand("$prefix${input} ${it.name}")) {
66+
clickEvent(suggestCommand("$prefix${input} ${it.commandName}")) {
6767
styled(if (it.isEnabled) Color.GREEN else Color.RED) {
68-
literal(it.name)
68+
literal(it.commandName)
6969
}
7070
}
7171
}

0 commit comments

Comments
 (0)