-
-
Notifications
You must be signed in to change notification settings - Fork 737
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 support for user-installable apps #2633
base: master
Are you sure you want to change the base?
Add support for user-installable apps #2633
Conversation
a55eba3
to
5bc36cb
Compare
8bb9df6
to
34bae66
Compare
7d78c12
to
f2d4e9d
Compare
d2d8463
to
a1a3954
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.
Looking quite good
src/main/java/net/dv8tion/jda/api/entities/channel/concrete/GroupChannel.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/entities/ApplicationInfoImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/entities/ApplicationInfoImpl.java
Outdated
Show resolved
Hide resolved
...va/net/dv8tion/jda/internal/entities/channel/concrete/detached/DetachedStageChannelImpl.java
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/entities/detached/DetachedMemberImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/entities/detached/DetachedMemberImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/entities/detached/DetachedRoleImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/entities/detached/DetachedRoleImpl.java
Outdated
Show resolved
Hide resolved
There seems to be a caching issue |
c495b94
to
5488620
Compare
Should be fixed |
I am not sure if this is an issue on my code or the library it's not an issue on my client as it also occurs for other people |
As you mentioned, restarting the client fixes the issue, so it's not a JDA issue |
I really doubt it's not a JDA issue, it works in other discord frameworks sigh at this point I just give up, I have to resort to putting my image in an embed (by using the thing that annoys me the most is that it used to work, I don't know what changed nor do I know if it's something to do with your new changes |
Can't repro with the code below, please share minimal reproduction code if you can public void onSlashReplyEditAttachment(SlashCommandInteractionEvent event, Message.Attachment attachment, Message.Attachment attachment2) throws Exception {
final byte[] bytes = getBytes(attachment);
final byte[] bytes2 = getBytes(attachment2);
event.replyFiles(FileUpload.fromData(bytes, attachment.getFileName()))
.setEphemeral(true) // Tried without ephemeral too
.queue();
event.getHook()
.editOriginalAttachments(FileUpload.fromData(bytes2, attachment.getFileName()))
.queue();
}
private byte[] getBytes(Message.Attachment attachment) throws Exception {
try (InputStream stream = attachment.getProxy().download().get()) {
return stream.readAllBytes();
}
} |
Maybe a UserJoinEvent(like GuildJoinEvent for userapps) and a JDA.getInstalledAppUsers()(like JDA.getGuilds() for userapps) |
Discord doesn't have a way to get who installed the application on their accounts As a reminder, JDA adds what Discord documents, if it isn't in the Discord docs, we can't add it |
I don't know if it's a limitation from Discord API, however, when trying to use |
aec9657
to
70e5e5c
Compare
I have been running this PR in production since 24/07 and I haven't found any issues, thanks freya! pets the freya |
…ionUtil Also document
src/main/java/net/dv8tion/jda/api/entities/detached/IDetachableEntity.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/api/interactions/IntegrationOwners.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/commands/build/CommandData.java
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/api/interactions/commands/build/CommandData.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/api/interactions/commands/build/SlashCommandData.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/entities/AbstractEntityBuilder.java
Outdated
Show resolved
Hide resolved
@Override | ||
public long getIdLong() | ||
{ | ||
return id; | ||
} |
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.
Missing docs
src/main/java/net/dv8tion/jda/internal/entities/InteractionEntityBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/entities/InteractionEntityBuilder.java
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/entities/InteractionEntityBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/net/dv8tion/jda/internal/entities/SelectMenuMentions.java
Outdated
Show resolved
Hide resolved
...va/net/dv8tion/jda/internal/entities/channel/concrete/detached/DetachedForumChannelImpl.java
Show resolved
Hide resolved
Co-authored-by: Florian Spieß <[email protected]> Co-authored-by: DV8FromTheWorld <[email protected]>
Makes more sense for initialization order
Partial revert of d0d11ac
Pull Request Etiquette
Changes
Closes Issue: NaN
Description
This adds support for user-installable apps (Preview, Release).
You are able to create application commands using the new properties, read the new data structures provided in
ApplicationInfo
,Interaction
andMessage
, as well as responding to interactions in detached guilds (where your bot isn't it in) and group DMs.Interesting elements include:
(Slash)CommandData#setContexts
(Default:GUILD
andBOT_DM
)(Slash)CommandData#setIntegrationTypes
(Default:GUILD_INSTALL
)IDetachableEntity#isDetached
(forGuild
,Channel
,Role
,Member
...)Interaction#hasFullGuild
Interaction#getIntegrationOwners
Message#getInteractionMetadata
Note: The default contexts and integration types align with the current behavior, meaning there is no breaking change.
You can see examples here, you can also see the example changes in the
Files changed
tab.Installation (Preview)
You can use the "Using new features" guide from the JDA wiki.
Alternatively, you can get the newest version for your favorite tool, by using the
/jitpack pr
command in the JDA Discord server. You can use theUpdate PR
button to merge the latest changes if necessary (note that it may not update it if there are conflicts).