Hello! So basically my embed for my upcoming ranking bot has an embed error,
(ERROR)
RankCraft#7766 is ready to assist people with ranking
Attempting to connect to the database
(node:9424) [MONGODB DRIVER] Warning: useNewUrlParser is a deprecated option: useNewUrlParser has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9424) [MONGODB DRIVER] Warning: useUnifiedTopology is a deprecated option: useUnifiedTopology has no effect since Node.js Driver version 4.0.0 and will be removed in the next major version
Successfully registered (2) commands globally.
____________MONGOOSE____________
CONNECTED TO THE DATABASE
____________MONGOOSE____________
Logged in as RankCraftX1 (5735671213)
node:events:496
throw er; // Unhandled 'error' event
^
DiscordAPIError[10062]: Unknown interaction
at handleErrors (C:\Users\Ethan\OneDrive\Desktop\RankCraft\node_modules\@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\Ethan\OneDrive\Desktop\RankCraft\node_modules\@discordjs\rest\dist\index.js:826:23)
at async _REST.request (C:\Users\Ethan\OneDrive\Desktop\RankCraft\node_modules\@discordjs\rest\dist\index.js:1266:22)
at async ChatInputCommandInteraction.reply (C:\Users\Ethan\OneDrive\Desktop\RankCraft\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:111:5)
at async Object.execute (C:\Users\Ethan\OneDrive\Desktop\RankCraft\commands\setup.js:36:17)
at async Client.<anonymous> (C:\Users\Ethan\OneDrive\Desktop\RankCraft\index.js:109:2)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:401:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: {
files: [],
json: {
type: 4,
data: {
content: ' ',
tts: false,
nonce: undefined,
embeds: [
{
color: 15548997,
title: 'Taken Group',
description: 'This group id has already been setted up, Think this is a problem? Go open a ticket in our server.'
}
],
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: 64,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
}
},
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: '(NOT GIVING YOU MY URL)'
}
Node.js v20.11.1
(My Code)
const { PermissionFlagsBits, EmbedBuilder, Embed, PermissionsBitField, ActionRowBuilder, ButtonBuilder, ButtonStyle, Guild } = require('discord.js');
const noblox = require('noblox.js')
const { SlashCommandBuilder, messageLink } = require('@discordjs/builders')
const setup = require('../Schema/setup');
const supportGuildID = '1209961261538738177'
const supportGuildIDChannel = '1224398128921317386'
module.exports = {
data: new SlashCommandBuilder()
.setName('setup')
.setDescription('Setup your bot.')
.addNumberOption(option => option.setName('groupid').setDescription('Enter a valid group ID to use.').setRequired(true)),
async execute(interaction, client) {
if(!interaction.guild) return await interaction.reply('Please use this in a server!')
const { options, guild } = interaction;
const supportGuild = client.guilds.cache.get('1209961261538738177')
const member = supportGuild.members.cache.get(interaction.user.id)
const isEarlyAccess = member ? member.roles.cache.get('1224360424749924494') : false
const GroupID = options.getNumber('groupid');
const ServerAlreadySettedUp = await setup.findOne({ GuildID: guild.id })
const AlreadyRegisteredGroup = await setup.findOne({ Groupid: GroupID })
const AlreadyRegistered = new EmbedBuilder()
.setColor('Red')
.setTitle('Taken Group')
.setDescription('This group id has already been setted up, Think this is a problem? Go open a ticket in our server.');
const AlreadySettedUp = new EmbedBuilder()
.setColor('Red')
.setTitle('Setted up')
.setDescription('This server is already setted up, If you want to want to remove the server from linking to the group please open a ticket in our server.');
if (AlreadyRegisteredGroup) {
await interaction.reply({ content: ' ', ephemeral: true, embeds: [AlreadyRegistered ]})
return;
};
if (ServerAlreadySettedUp) {
await interaction.reply({ content: ' ', ephemeral: true, embeds: [AlreadySettedUp ]})
return;
};
const RequestedBotEmbed = new EmbedBuilder()
.setColor('Orange')
.setTitle('Bot Requested')
.setDescription('A guild requested a bot to be in their group!')
.addFields({ name: 'Guild ID', value: `${interaction.guild.id}` }, { name: 'Sender ID', value: `${interaction.user.id}` })
.setTimestamp();
if (isEarlyAccess) {
} else {
const ForbiddenEmbed = new EmbedBuilder()
.setColor('Red')
.setTitle('Not Whitelisted')
.setDescription('This command is currently wip and you are trying to use it, please wait for it to release, \n\n\n\(If you want the early access please pay 500 robux into our tshirt')
await interaction.reply({ embeds: [ForbiddenEmbed] })
}
},
};