mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 08:03:30 +01:00
feat(monetization): Add get entitlement endpoint (#10605)
feat(monetization): add get entitlement endpoint Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import { makeURLSearchParams, type RequestData, type REST } from '@discordjs/res
|
||||
import {
|
||||
Routes,
|
||||
type RESTGetAPIEntitlementsQuery,
|
||||
type RESTGetAPIEntitlementResult,
|
||||
type RESTGetAPIEntitlementsResult,
|
||||
type RESTGetAPISKUsResult,
|
||||
type RESTGetAPISKUSubscriptionResult,
|
||||
@@ -84,6 +85,24 @@ export class MonetizationAPI {
|
||||
}) as Promise<RESTGetAPIEntitlementsResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches an entitlement for an application.
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/entitlement#get-entitlement}
|
||||
* @param applicationId - The application id to fetch the entitlement for
|
||||
* @param entitlementId - The entitlement id to fetch
|
||||
* @param options - The options for fetching the entitlement
|
||||
*/
|
||||
public async getEntitlement(
|
||||
applicationId: Snowflake,
|
||||
entitlementId: Snowflake,
|
||||
{ signal }: Pick<RequestData, 'signal'> = {},
|
||||
) {
|
||||
return this.rest.get(Routes.entitlement(applicationId, entitlementId), {
|
||||
signal,
|
||||
}) as Promise<RESTGetAPIEntitlementResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a test entitlement for an application's SKU.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user