-
-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic support for activities #2751
base: master
Are you sure you want to change the base?
Conversation
40217d5
to
1201db8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Dropped a number of comments, but many are duplicates so when a decision is reached all the code is updated.
I think we should consider moving to "PrimaryEntrypointCommand" for a measure of consistency and code-self-explanation.
* | ||
* @see Guild#updateCommands() | ||
*/ | ||
@Nonnull | ||
@CheckReturnValue | ||
CommandListUpdateAction updateCommands(); | ||
GlobalCommandListUpdateAction updateCommands(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does renaming this break ABI? I haven't read further here, but this strikes me a possible problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe yes, as the method signatures in the bytecode include the parameters and return type signatures
src/main/java/net/dv8tion/jda/api/events/interaction/ModalInteractionEvent.java
Outdated
Show resolved
Hide resolved
...net/dv8tion/jda/api/events/interaction/component/GenericComponentInteractionCreateEvent.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/api/interactions/Interaction.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/api/interactions/callbacks/ILaunchActivityReplyCallback.java
Outdated
Show resolved
Hide resolved
* @see net.dv8tion.jda.api.interactions.commands.build.SlashCommandData | ||
* @see net.dv8tion.jda.api.interactions.commands.build.EntryPointCommandData | ||
*/ | ||
public interface INamedCommandData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know all commands support this functionality. I don't think we necessarily need to put this in an attributable interface
* | ||
* @see net.dv8tion.jda.api.interactions.callbacks.ILaunchActivityReplyCallback | ||
*/ | ||
public interface LaunchActivityCallbackAction extends InteractionCallbackAction<Void>, FluentRestAction<Void, LaunchActivityCallbackAction> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure the return type is Void? I thought we returned some data here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the current code, Discord will return a 204. After #2798, it will return a 200.
The interaction callback response PR should be merged before this one, so I can add the activity-specific data to it.
src/main/java/net/dv8tion/jda/api/interactions/commands/build/EntryPointCommandData.java
Outdated
Show resolved
Hide resolved
this.handler = json.hasKey("handler") | ||
? EntryPointCommandData.Handler.fromValue(json.getLong("handler")) | ||
: null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we aren't introducing a PrimaryEntrypointCommandImpl
that extends CommandImpl
?
src/main/java/net/dv8tion/jda/internal/interactions/command/CommandInteractionImpl.java
Outdated
Show resolved
Hide resolved
So we can reuse them on entry point commands
Allows updating the primary entry point
1201db8
to
ddd678b
Compare
Follows the same pattern as IAgeRestrictedCommandData
Also fix missing descriptions
Pull Request Etiquette
Changes
Closes Issue: NaN
Description
Depends on #2798, after which some activity-specific data will be added
Adds basic support for activities
Note: While it is open for reviews, some features are missing and might be added later