I am currently working on a Discord bot using the Discord4J library in Java, and I would like to create a slash command that is only available in a specific channel and is not suggested in other channels.
Currently, I have successfully implemented the slash command and it shows up in all channels where the bot is active. However, I would like the command to be suggested only in a specific channel and not appear in other channels.
I have implemented the command as any other already with the following code. However, there it is displayed in every channel and not only in a specific one as expected:
`List commandData = new ArrayList<>();
commandData.add(Commands.slash("poll", "Erstelle eine Umfrage")
.setDefaultPermissions(DefaultMemberPermissions.enabledFor(Permission.ADMINISTRATOR))
.setGuildOnly(true));`
Thanks in advance for your help!
You can disable the command from the server settings for certain channels. Unfortunately, you can't edit this via the API (not a Discord4J issue, it's a Discord restriction).