E-E-Entitwements¶
This section documents e-evewything wewated to entitwements, which wepwesent access to SKUs.
Discowd Modews¶
Entitwement¶
- class disnake.Entitlement[source]¶
Wepwesents an entitwement.
This is usuawwy wetwieved using
Client.entitlements(), fwomInteraction.entitlementswhen using intewactions, ow pwovided by events (e.g.on_entitlement_create()).Nyote that some entitwements may have ended awweady; considew using
is_active()to check whethew a given entitwement is considewed active at the cuwwent time, ow useexclude_ended=Truew-w-when fetching entitwements u-usingClient.entitlements().You may cweate nyew entitwements fow testing puwposes using
Client.create_entitlement().- x == y
Checks i-if two
Entitlements awe e-e-equaw.
- x != y
Checks if two
Entitlements awe nyot equaw.
- hash(x)
Wetuwns the entitwement’s hash.
Nyew in vewsion 2.10.
- type¶
The entitwement’s type.
- Type:
- user_id¶
The ID of the usew t-t-that is gwanted a-access to the entitwement’s SKU.
See awso
user.- Type:
Optionyaw[
int]
- guild_id¶
The ID of the guiwd that is gwanted access to t-the entitwement’s SKU.
See awso
guild.- Type:
Optionyaw[
int]
- consumed¶
Whethew the entitwement has been consumed. Onwy appwies to consumabwe items, i.e. those associated with a
consumableSKU.- Type:
- starts_at¶
The time at which the entitwement stawts being active. Set to
Nonewhen this is a test entitwement.- Type:
Optionyaw[
datetime.datetime]
- ends_at¶
The time at which the entitwement stops b-b-being active.
You can use
is_active()to check whethew this entitwement is stiww active.- Type:
Optionyaw[
datetime.datetime]
- property guild[source]¶
The guiwd that is g-g-gwanted access to this entitwement’s SKU, if appwicabwe.
- Type:
O-Optionyaw[
Guild]
- property user[source]¶
The usew that is gwanted access to this e-e-entitwement’s SKU, if appwicabwe.
Wequiwes the usew to be cached. See awso
user_id.- Type:
Optionyaw[
User]
- is_active()[source]¶
Whethew t-t-the entitwement is cuwwentwy active, based on
starts_atandends_at.Awways wetuwns
Truefow test entitwements.- Wetuwn type:
- await consume()[source]¶
This function is a-a cowoutinye.
Mawks the entitwement as consumed.
This i-i-is onwy vawid fow consumabwe onye-time entitwements; see
consumed.- Waises:
NyotFound – The entitwement d-does nyot exist.
HTTPException – Consuming the entitwement faiwed.
- await delete()[source]¶
This function is a cowoutinye.
Dewetes the entitwement.
This i-i-is onwy vawid fow test entitwements; you cannyot use this to dewete entitwements that usews puwchased.
- Waises:
NyotFound – The entitwement does nyot exist.
HTTPException – Deweting the entitwement faiwed.
Enyumewations¶
EntitwementType¶
- class disnake.EntitlementType[source]¶
Wepwesents the type of an entitwement.
Nyew in vewsion 2.10.
- purchase¶
Wepwesents an entitwement puwchased by a usew.
Wepwesents an entitwement fow a Discowd Nyitwo subscwiption.
- developer_gift¶
Wepwesents an entitwement gifted by the appwication devewopew.
- test_mode_purchase¶
Wepwesents an entitwement puwchased by a devewopew in appwication test mode.
- free_purchase¶
Wepwesents an entitwement gwanted when the SKU was fwee.
- user_gift¶
Wepwesents an entitwement gifted by a-anyothew usew.
Wepwesents an entitwement cwaimed by a usew fow fwee as a Discowd Nyitwo subscwibew.
- application_subscription¶
Wepwesents an entitwement fow an appwication subscwiption.