Entitlement Update Event

Discord.js version: 15.0.0 Hello, I would appreciate any help/guidance around handling the EntitlementUpdate event. What type of object is passed to this event? I assumed I would receive an Entitlement, but when I receive the event, it triggers the attached error message. The topmost error is:
TypeError: Cannot read properties of null (reading 'skuId')
TypeError: Cannot read properties of null (reading 'skuId')
Here are the first two lines of my event handler, for additional context:
export async function execute(entitlement: Entitlement) {
if (entitlement.skuId === Membership) {
export async function execute(entitlement: Entitlement) {
if (entitlement.skuId === Membership) {
Thanks!
No description
4 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
edocsil
edocsil5mo ago
The first param, oldEntitlement, can be null. Though I'm not sure when that's the case
d.js docs
d.js docs5mo ago
:event: (event) Client#entitlementUpdate discord.js@14.21.0 Emitted whenever an entitlement is updated - i.e. when a user's subscription renews.
Madeline
MadelineOP5mo ago
@edocsil thanks so much! I installed it in order to start using CV2 prior to it being added to the stable release I'd have to look at backups to see which release I switched to to use CV2 Okay now I see... I was on 14.18 originally I didn't know which release would have the CV2 changes since the PR was still open at the time So I just assumed that the latest release would Thanks for clarifying, that makes sense Sorry, I'm not very well-versed in git

Did you find this page helpful?