discord-jda / JDA

Java wrapper for the popular chat & VOIP service: Discord https://discord.com
Apache License 2.0
4.29k stars 738 forks source link

Add support for premium app subscriptions #2583

Closed Giuliopime closed 5 months ago

Giuliopime commented 10 months ago

Changes

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 commented 10 months ago

Anything blocking this pr?

DxsSucuk commented 9 months ago

Anything new about this?

freya022 commented 9 months ago

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

DxsSucuk commented 9 months ago

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?

Giuliopime commented 9 months ago

@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

MinnDevelopment commented 8 months ago

What is holding this back?

Giuliopime commented 8 months ago

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

BurntRouter commented 7 months ago

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

Giuliopime commented 7 months ago

@MartinItsLinda

MartinItsLinda commented 7 months ago

@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 commented 7 months ago

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?

Giuliopime commented 7 months ago

Mb re-requested review for no reason sorry

MartinItsLinda commented 7 months ago

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

MartinItsLinda commented 7 months ago

This is ready for review again now,

MartinItsLinda commented 7 months ago

Is there anything preventing this from being merged now?

MinnDevelopment commented 6 months ago

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.

MartinItsLinda commented 6 months ago

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

DxsSucuk commented 6 months ago

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

Giuliopime commented 6 months ago

@MartinItsLinda can you pr on my repo the change?