
com.freya02.botcommands.internal.commands.application.slash.TopLevelSlashCommandInfo.kt Maven / Gradle / Ivy
package com.freya02.botcommands.internal.commands.application.slash
import com.freya02.botcommands.api.commands.application.slash.builder.TopLevelSlashCommandBuilder
import com.freya02.botcommands.internal.BContextImpl
import com.freya02.botcommands.internal.commands.application.slash.mixins.ITopLevelSlashCommandInfo
import com.freya02.botcommands.internal.commands.application.slash.mixins.TopLevelSlashCommandInfoMixin
class TopLevelSlashCommandInfo internal constructor(
context: BContextImpl,
builder: TopLevelSlashCommandBuilder
) : SlashCommandInfo(context, builder),
ITopLevelSlashCommandInfo by TopLevelSlashCommandInfoMixin(context, builder) {
override val topLevelInstance: TopLevelSlashCommandInfo = this
override val parentInstance = null
val subcommands: Map = builder.subcommands.map.mapValues { it.value.build(this, this) }
val subcommandGroups: Map = builder.subcommandGroups.map.mapValues { it.value.build(this) }
fun isTopLevelCommandOnly() = subcommands.isEmpty() && subcommandGroups.isEmpty()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy