From 9356d37be912cf26217c3a6851cef5bfdffb304b Mon Sep 17 00:00:00 2001 From: Lukellmann Date: Tue, 17 May 2022 01:18:13 +0200 Subject: [PATCH] Use GuildMultiApplicationCommandBuilder in lambda types (small fix for #604) --- core/src/main/kotlin/Kord.kt | 2 +- core/src/main/kotlin/behavior/GuildBehavior.kt | 7 ++----- .../builder/interaction/ApplicationCommandBuilders.kt | 10 ++++------ rest/src/main/kotlin/route/Route.kt | 1 + 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/core/src/main/kotlin/Kord.kt b/core/src/main/kotlin/Kord.kt index 46e7b9fbf495..e2e8771ce640 100644 --- a/core/src/main/kotlin/Kord.kt +++ b/core/src/main/kotlin/Kord.kt @@ -568,7 +568,7 @@ public class Kord( public suspend inline fun createGuildApplicationCommands( guildId: Snowflake, - builder: MultiApplicationCommandBuilder.() -> Unit, + builder: GuildMultiApplicationCommandBuilder.() -> Unit, ): Flow { contract { callsInPlace(builder, InvocationKind.EXACTLY_ONCE) } diff --git a/core/src/main/kotlin/behavior/GuildBehavior.kt b/core/src/main/kotlin/behavior/GuildBehavior.kt index 33426dc875a1..1d34ccbb660f 100644 --- a/core/src/main/kotlin/behavior/GuildBehavior.kt +++ b/core/src/main/kotlin/behavior/GuildBehavior.kt @@ -36,10 +36,7 @@ import dev.kord.rest.builder.auditlog.AuditLogGetRequestBuilder import dev.kord.rest.builder.ban.BanCreateBuilder import dev.kord.rest.builder.channel.* import dev.kord.rest.builder.guild.* -import dev.kord.rest.builder.interaction.ChatInputCreateBuilder -import dev.kord.rest.builder.interaction.MessageCommandCreateBuilder -import dev.kord.rest.builder.interaction.MultiApplicationCommandBuilder -import dev.kord.rest.builder.interaction.UserCommandCreateBuilder +import dev.kord.rest.builder.interaction.* import dev.kord.rest.builder.role.RoleCreateBuilder import dev.kord.rest.builder.role.RolePositionsModifyBuilder import dev.kord.rest.json.JsonErrorCode @@ -656,7 +653,7 @@ public suspend inline fun GuildBehavior.createUserCommand( public suspend inline fun GuildBehavior.createApplicationCommands( - builder: MultiApplicationCommandBuilder.() -> Unit + builder: GuildMultiApplicationCommandBuilder.() -> Unit ): Flow { contract { callsInPlace(builder, InvocationKind.EXACTLY_ONCE) } return kord.createGuildApplicationCommands(id, builder) diff --git a/rest/src/main/kotlin/builder/interaction/ApplicationCommandBuilders.kt b/rest/src/main/kotlin/builder/interaction/ApplicationCommandBuilders.kt index c2c61c31126e..55ceccd13d58 100644 --- a/rest/src/main/kotlin/builder/interaction/ApplicationCommandBuilders.kt +++ b/rest/src/main/kotlin/builder/interaction/ApplicationCommandBuilders.kt @@ -18,9 +18,9 @@ public interface ApplicationCommandCreateBuilder : LocalizedNameCreateBuilder, public val type: ApplicationCommandType /** - * Disables the command for everyone by default. + * Disables the command for everyone except admins by default. * - * **This does not ensure normal users cannot execute the command, any server owner can change this setting** + * **This does not ensure normal users cannot execute the command, any admin can change this setting.** */ public fun disableCommandInGuilds() { defaultMemberPermissions = Permissions() @@ -28,14 +28,12 @@ public interface ApplicationCommandCreateBuilder : LocalizedNameCreateBuilder, } @KordDsl -public interface GlobalApplicationCommandCreateBuilder : ApplicationCommandCreateBuilder, - RequestBuilder { +public interface GlobalApplicationCommandCreateBuilder : ApplicationCommandCreateBuilder { public var dmPermission: Boolean? } @KordDsl -public interface GlobalApplicationCommandModifyBuilder : ApplicationCommandModifyBuilder, - RequestBuilder { +public interface GlobalApplicationCommandModifyBuilder : ApplicationCommandModifyBuilder { public var dmPermission: Boolean? } diff --git a/rest/src/main/kotlin/route/Route.kt b/rest/src/main/kotlin/route/Route.kt index 61a67cf66759..77c8b7f391f1 100644 --- a/rest/src/main/kotlin/route/Route.kt +++ b/rest/src/main/kotlin/route/Route.kt @@ -806,6 +806,7 @@ public sealed class Route( DiscordGuildApplicationCommandPermissions.serializer() ) + /* * Guild Scheduled Event: * https://discord.com/developers/docs/resources/guild-scheduled-event