Skip to content
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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

freya022
Copy link
Contributor

@freya022 freya022 commented Oct 14, 2024

Pull Request Etiquette

Changes

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

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

Sorry, something went wrong.

@freya022 freya022 marked this pull request as ready for review October 18, 2024 20:36
Copy link
Member

@DV8FromTheWorld DV8FromTheWorld left a 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();
Copy link
Member

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

Copy link
Contributor Author

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

* @see net.dv8tion.jda.api.interactions.commands.build.SlashCommandData
* @see net.dv8tion.jda.api.interactions.commands.build.EntryPointCommandData
*/
public interface INamedCommandData
Copy link
Member

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>
Copy link
Member

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

Copy link
Contributor Author

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.

Comment on lines 77 to 85
this.handler = json.hasKey("handler")
? EntryPointCommandData.Handler.fromValue(json.getLong("handler"))
: null;
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants