@@ -4,6 +4,7 @@ import { makeURLSearchParams, type RequestData, type REST } from '@discordjs/res
44import {
55 Routes ,
66 type RESTGetAPIEntitlementsQuery ,
7+ type RESTGetAPIEntitlementResult ,
78 type RESTGetAPIEntitlementsResult ,
89 type RESTGetAPISKUsResult ,
910 type RESTGetAPISKUSubscriptionResult ,
@@ -84,6 +85,24 @@ export class MonetizationAPI {
8485 } ) as Promise < RESTGetAPIEntitlementsResult > ;
8586 }
8687
88+ /**
89+ * Fetches an entitlement for an application.
90+ *
91+ * @see {@link https://discord.com/developers/docs/resources/entitlement#get-entitlement }
92+ * @param applicationId - The application id to fetch the entitlement for
93+ * @param entitlementId - The entitlement id to fetch
94+ * @param options - The options for fetching the entitlement
95+ */
96+ public async getEntitlement (
97+ applicationId : Snowflake ,
98+ entitlementId : Snowflake ,
99+ { signal } : Pick < RequestData , 'signal' > = { } ,
100+ ) {
101+ return this . rest . get ( Routes . entitlement ( applicationId , entitlementId ) , {
102+ signal,
103+ } ) as Promise < RESTGetAPIEntitlementResult > ;
104+ }
105+
87106 /**
88107 * Creates a test entitlement for an application's SKU.
89108 *
0 commit comments