rehlithe
rehlithe
Explore posts from servers
KKord
Created by rehlithe on 6/15/2024 in #help
Chat input command trailing lambda separation
I have made a solution
suspend fun register(bot: Bot, guildId: Snowflake?, builder: ChatInputCreateBuilder.() -> Unit) {
if (guildId == null) {
bot.kord.createGlobalChatInputCommand(name, description, builder)
} else {
bot.kord.createGuildChatInputCommand(guildId, name, description, builder)
}
}
suspend fun register(bot: Bot, guildId: Snowflake?, builder: ChatInputCreateBuilder.() -> Unit) {
if (guildId == null) {
bot.kord.createGlobalChatInputCommand(name, description, builder)
} else {
bot.kord.createGuildChatInputCommand(guildId, name, description, builder)
}
}
3 replies