File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ import {
1414 type Snowflake ,
1515} from 'discord-api-types/v10' ;
1616
17+ // TODO: discord-api-types
18+ type RESTGetAPIEntitlementResult = RESTGetAPIEntitlementsResult [ number ] ;
19+
1720export class MonetizationAPI {
1821 public constructor ( private readonly rest : REST ) { }
1922
@@ -84,6 +87,24 @@ export class MonetizationAPI {
8487 } ) as Promise < RESTGetAPIEntitlementsResult > ;
8588 }
8689
90+ /**
91+ * Fetches an entitlement for an application.
92+ *
93+ * @see {@link https://discord.com/developers/docs/resources/entitlement#list-entitlements }
94+ * @param applicationId - The application id to fetch entitlements for
95+ * @param query - The query options for fetching entitlements
96+ * @param options - The options for fetching entitlements
97+ */
98+ public async getEntitlement (
99+ applicationId : Snowflake ,
100+ entitlementId : Snowflake ,
101+ { signal } : Pick < RequestData , 'signal' > = { } ,
102+ ) {
103+ return this . rest . get ( Routes . entitlement ( applicationId , entitlementId ) , {
104+ signal,
105+ } ) as Promise < RESTGetAPIEntitlementResult > ;
106+ }
107+
87108 /**
88109 * Creates a test entitlement for an application's SKU.
89110 *
You can’t perform that action at this time.
0 commit comments