Closed Galarzaa90 closed 2 years ago
The property allowInDms for slash commands is not being used when registering the commands to Discord, resulting in the commands being visible in DMs.
allowInDms
kordex-1.5.5-SNAPSHOT
ephemeralSlashCommand { name = "events" description = "Description" allowInDms = false action { //.. } }
The command will still be available in private messages.
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.
register
ChatInputCreateBuilder.register
GlobalChatInputCreateBuilder.register
dmPermissions
false
This was fixed in #175
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
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 notGlobalChatInputCreateBuilder.register
, sodmPermissions
is never set tofalse
on the payload sent to the API.