Issues with Entitlements

Hey everyone! I'm having some issues with checking the entitlements of servers. It always displays, that the server doesn't own it. I have also tried some other code snippets.
const entitlements = await client.application.entitlements.fetch()
const targetSkuId = '-';
const guildId = interaction.guild.id;
const guildHasSubscription = entitlements.some(ent =>
ent.isGuildSubscription() &&
ent.guildId === guildId &&
ent.skuId === targetSkuId &&
ent.isActive()
);

if (!guildHasSubscription) {
const entitlements = await client.application.entitlements.fetch()
const targetSkuId = '-';
const guildId = interaction.guild.id;
const guildHasSubscription = entitlements.some(ent =>
ent.isGuildSubscription() &&
ent.guildId === guildId &&
ent.skuId === targetSkuId &&
ent.isActive()
);

if (!guildHasSubscription) {
2 Replies
d.js toolkit
d.js toolkit2mo 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
Robin
RobinOP2mo ago
I was able to fix it, thank you.

Did you find this page helpful?