Kord-Extensions/kord-extensions

Global commands not setting `dm_permission` property

Galarzaa90 opened this issue · 1 comments

Description

The property allowInDms for slash commands is not being used when registering the commands to Discord, resulting in the commands being visible in DMs.

Versions

kordex-1.5.5-SNAPSHOT

Reproduction

ephemeralSlashCommand {
    name = "events"
    description = "Description"
    allowInDms = false
    action { 
        //..
    }
}

The command will still be available in private messages.

Suggestions

This is the part that is registering each command: https://github.com/Kord-Extensions/kord-extensions/blob/develop/kord-extensions/src/main/kotlin/com/kotlindiscord/kord/extensions/commands/application/DefaultApplicationCommandRegistry.kt#L204-L210

However, when that register method is being called, it is calling: ChatInputCreateBuilder.register and not GlobalChatInputCreateBuilder.register, so dmPermissions is never set to false on the payload sent to the API.

This was fixed in #175