-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(EntitlementManager): Support get entitlement #10606
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
/** | ||
* Options used to fetch an entitlement | ||
* @typedef {BaseFetchOptions} FetchEntitlementOptions | ||
* @property {EntitlementResolvable} entitlement The entitlement to fetch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be EntitlementResolvable instead of just Snowflake? Doesn't make much sense to fetch an entitlement using itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this for consistency reasons (message fetching, event fetching, thread member fetching, etc.), but we can remove it if we feel strongly about it.
async fetch({ limit, guild, user, skus, excludeEnded, cache = true, before, after } = {}) { | ||
async fetch(options) { | ||
if (!options) return this._fetchMany(options); | ||
const { entitlement, cache, force } = options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { entitlement, cache, force } = options; | |
const { entitlement, cache = true, force } = options; |
return this._add(data, cache); | ||
} | ||
|
||
async _fetchMany({ limit, guild, user, skus, excludeEnded, excludeDelete, cache, before, after } = {}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't cache
default to true as it was previously?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It already is defaulted to true
in _add()
. Adding true
here isn't actually doing anything.
Co-authored-by: Danial Raza <[email protected]>
Please describe the changes this PR makes and why it should be merged:
Status and versioning classification: