Robin
Robin
DIAdiscord.js - Imagine an app
Created by Robin on 3/17/2025 in #djs-questions
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) {
3 replies