79261699

Date: 2024-12-08 01:12:26
Score: 2
Natty:
Report link

I did not find any typo and the way you are trying to get the boost count seems correct.

But as the error says, it looks like your guild is null. Are you using this command in the guild or DM? Let's do basic and simple debugging. Check what you get from console.log(interaction.guild) or even console.log(interaction).

If you get normal data, the problem could be in approaching to the Discord API and getting data from Guild.

  1. Try fetching the guild (e.g. AWAIT bot.guilds.fetch(interaction.guild) await is important!)
  2. Check if the guild is available (if (interaction.guild.available))

By the way, premiumSubscriptionCount could be null (check docs here)

PS Are you using the latest discord.js version?

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: PetyXbron