JDA icon indicating copy to clipboard operation
JDA copied to clipboard

Add support for SelectMenus in Modals

Open Xirado opened this issue 2 years ago • 15 comments

Pull Request Etiquette

Changes

  • [x] Internal code
  • [x] Library interface (affecting end-user code)
  • [x] Documentation
  • [ ] Other: _____

Closes Issue: #2161

Description

Adds support for SelectMenus in Modals.

Disclaimer: This is not yet documented by Discord.

Xirado avatar Jun 23 '22 06:06 Xirado

@seailz you can use the current PR through jitpack. This is explained in our wiki.

Please only use the comments of pull requests for discussion of the implementation and feedback.

MinnDevelopment avatar Jul 04 '22 11:07 MinnDevelopment

@seailz you can use the current PR through jitpack. This is explained in our wiki.

Yeah just waiting for it to be merged & for discord's doc

Please only use the comments of pull requests for discussion of the implementation and feedback.

Sorry about that

seailz avatar Jul 04 '22 11:07 seailz

also by the way, trying to use this throws an error

[JDA MainWS-ReadThread] ERROR JDA - One of the EventListeners had an uncaught exception
java.lang.IllegalArgumentException: Some components are incompatible with Modals
- root.components[0].components[0] - <SELECT_MENU>
	at net.dv8tion.jda.internal.utils.Checks.checkComponents(Checks.java:248)
	at net.dv8tion.jda.api.interactions.components.Modal$Builder.addActionRows(Modal.java:246)
	at net.dv8tion.jda.api.interactions.components.Modal$Builder.addActionRows(Modal.java:222)
	at net.dv8tion.jda.api.interactions.components.Modal$Builder.addActionRow(Modal.java:295)
	at TestCommand.onSlashCommandInteraction(TestCommand.java:12)
	at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:382)
	at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
	at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88)
	at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70)
	at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:169)
	at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleCommand(InteractionCreateHandler.java:109)
	at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleInternally(InteractionCreateHandler.java:80)
	at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:36)
	at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:954)
	at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:841)
	at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:819)
	at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:993)
	at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385)
	at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276)
	at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996)
	at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755)
	at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
	at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
	at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

@Xirado

seailz avatar Jul 05 '22 21:07 seailz

You are probably still using the old JDA version. Make sure you removed the old JDA version before using the Jitpack build.

freya022 avatar Jul 05 '22 21:07 freya022

You are probably still using the old JDA version. Make sure you removed the old JDA version before using the Jitpack build.

Unfortunately that's not the case, I've double checked my pom

update: I managed to fix this

seailz avatar Jul 05 '22 21:07 seailz

Any new information when this will be ready ?

LucGamesYT avatar Aug 04 '22 14:08 LucGamesYT

Any new information when this will be ready ?

This feature is not even released by Discord, it only works on Desktop, and is not documented. See this link if you still want to use it.

Xirado avatar Aug 04 '22 15:08 Xirado

hasn't worked for 2 hours

CreaCloudz avatar Aug 17 '22 21:08 CreaCloudz

@CreaCloudz Discord blocks you from using it because its not released.

MinnDevelopment avatar Aug 17 '22 21:08 MinnDevelopment

@CreaCloudz Discord blocks you from using it because its not released.

Not exactly seeing that it still works in JS

CreaCloudz avatar Aug 18 '22 10:08 CreaCloudz

@CreaCloudz Discord blocks you from using it because its not released.

Not exactly seeing that it still works in JS

no it doesn't

Xirado avatar Aug 18 '22 10:08 Xirado

Discord restricted access to Selects in Modals because people were using them before they were ready to be released and breaking mobile experiences for users and causing Discord to catch flack from confused bot devs and frustrated users.

Essentially, Discord's hand was forced because people were using an unreleased feature before it was ready.

DV8FromTheWorld avatar Aug 18 '22 17:08 DV8FromTheWorld

Discord restricted access to Selects in Modals because people were using them before they were ready to be released and breaking mobile experiences for users and causing Discord to catch flack from confused bot devs and frustrated users.

Essentially, Discord's hand was forced because people were using an unreleased feature before it was ready.

Thanks for the info, hope he adds it soon.

CreaCloudz avatar Aug 18 '22 22:08 CreaCloudz

Frozen until the feature is actually functional again.

DV8FromTheWorld avatar Sep 11 '22 04:09 DV8FromTheWorld

This PR will be updated when there are news. No need to ask.

MinnDevelopment avatar Feb 11 '23 09:02 MinnDevelopment