JDA icon indicating copy to clipboard operation
JDA copied to clipboard

Add support for premium app subscriptions: gateway events, new interaction responsea and entitlements data in interactions

Open Giuliopime opened this issue 2 years ago • 15 comments

  • [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

Giuliopime avatar Nov 14 '23 00:11 Giuliopime

Anything blocking this pr?

Giuliopime avatar Nov 21 '23 11:11 Giuliopime

Anything new about this?

DxsSucuk avatar Nov 24 '23 13:11 DxsSucuk

You can use a preview of the feature by following this tutorial

freya022 avatar Nov 24 '23 13:11 freya022

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?

DxsSucuk avatar Nov 24 '23 13:11 DxsSucuk

@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

Giuliopime avatar Dec 03 '23 13:12 Giuliopime

What is holding this back?

MinnDevelopment avatar Jan 21 '24 09:01 MinnDevelopment

A bug in the pagination, didn't have time to look at it yet

Giuliopime avatar Jan 21 '24 09:01 Giuliopime

@Giuliopime what's the bug? Can help if you don't have the time as I'm actively looking for this feature in JDA.

BurntRouter avatar Feb 06 '24 01:02 BurntRouter

@MartinItsLinda

Giuliopime avatar Feb 06 '24 06:02 Giuliopime

@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.

MartinItsLinda avatar Feb 06 '24 16:02 MartinItsLinda

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?

MartinItsLinda avatar Feb 08 '24 00:02 MartinItsLinda

Mb re-requested review for no reason sorry

Giuliopime avatar Feb 08 '24 01:02 Giuliopime

Found the cause, it was to do with Collections.reverse when pagination order was set to REVERSE

MartinItsLinda avatar Feb 08 '24 01:02 MartinItsLinda

This is ready for review again now,

MartinItsLinda avatar Feb 09 '24 11:02 MartinItsLinda

Is there anything preventing this from being merged now?

MartinItsLinda avatar Feb 19 '24 14:02 MartinItsLinda

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.

MinnDevelopment avatar Feb 26 '24 18:02 MinnDevelopment

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

MartinItsLinda avatar Feb 26 '24 18:02 MartinItsLinda

Can this PR be bumped up to the latest master commits?

DxsSucuk avatar Mar 06 '24 12:03 DxsSucuk

@MartinItsLinda can you pr on my repo the change?

Giuliopime avatar Mar 17 '24 10:03 Giuliopime