#I got an error "field cannot be empty"

3 messages · Page 1 of 1 (latest)

bleak karma

Data.status should not be empty according to my code:
const Discord = require('discord.js');
const axios = require('axios');

module.exports = {
name: 'verify',
description: 'Verify your account with Bloxlink.',
async execute(interaction) {
// Check if user has permission to send messages
if (!interaction.member.permissions.has('SEND_MESSAGES')) {
return interaction.reply('You do not have permission to send messages.');
}

// Retrieve the user to verify
const verifiedUser = interaction.user;

// Retrieve the user's Discord ID
const discordId = verifiedUser.id;

// Send a request to the Bloxlink API to verify the user's account
const apiKey = process.env.BLOXLINK_API_KEY;
const guildId = process.env.guildID;
const apiUrl = https://v3.blox.link/developer/discord/${discordId}?guildId=${guildId};

try {
  const response = await axios.get(apiUrl, {
    headers: {
      'api-key': apiKey
    }
  });

  const data = response.data;
  const success = data.status === 'ok';
wheat whale

Don’t work with should or according to my code. Simply console.log(data.status) to check

calm tree

is bro tryna make a scam bot lmao