JDA
JDA copied to clipboard
Add support for premium app subscriptions: gateway events, new interaction responsea and entitlements data in interactions
- [x] I have checked the PRs for upcoming features/bug fixes.
- [x] I have read the [contributing guidelines][contributing].
Changes
- [x] Internal code
- [x] Library interface (affecting end-user code)
- [ ] Documentation
- [ ] Other: _____
Closes Issue: NaN
Description
This PR adds support for Discord premium App subscriptions It allows developers to receive gateway events for Entitlements, reply with the new "PREMIUM_REQUIRED" interaction response type, get access to the entitlements of a guild / user directly from the received interaction, fetch entitlements directly
Anything blocking this pr?
Anything new about this?
You can use a preview of the feature by following this tutorial
You can use a preview of the feature by following this tutorial
Well aware, but I am just asking what the current status of this Issue is? Will it be merged, or will it take sometime?
@MartinItsLinda added support for fetching entitlements from Discord with optional query parameters like guild_id, user_id etc... https://discord.com/developers/docs/monetization/entitlements#list-entitlements
What is holding this back?
A bug in the pagination, didn't have time to look at it yet
@Giuliopime what's the bug? Can help if you don't have the time as I'm actively looking for this feature in JDA.
@MartinItsLinda
@BurntRouter The requester keeps infinitely requesting until it dies like Minn said. I don't know what's going on with that as I only had very little time to look into it and I don't understand JDAs pagination logic enough to know what's causing it.
So decided to take a look into this again, the pagination bug only exists in REVERSE order (JDAs default). Using FORWARD as the order yields the same amount of entitlements as the Discord API.
I'd hazard a guess that this is to do with lastKey?
Mb re-requested review for no reason sorry
Found the cause, it was to do with Collections.reverse when pagination order was set to REVERSE
This is ready for review again now,
Is there anything preventing this from being merged now?
Is there anything preventing this from being merged now?
I want to see if I can get a test bot to test the changes myself too, other than that it's mostly just up to me finding time to go over this again.
I want to see if I can get a test bot to test the changes myself too, other than that it's mostly just up to me finding time to go over this again.
I can show this working with 100+ subs if it makes your life a bit easier in that regard
Can this PR be bumped up to the latest master commits?
@MartinItsLinda can you pr on my repo the change?