import { CommandType } from "#lib/enums"; import { Command } from "#lib/structures"; import { ApplicationCommandOptionType } from "discord.js"; import { inspect } from "node:util"; import "dotenv/config"; export default new Command({ type: CommandType.ChatInput, description: "Eval Some Code", ownerOnly: true, guildIds: [`${parseInt(`${process.env.GUILD_ID}`)}`], // Insert your Testing Guild ID Here options: [ { name: "code", description: "The code to evaluate", required: true, type: ApplicationCommandOptionType.String, }, ], async commandRun(interaction) { const code = interaction.options.getString("code", true); const { client, channel, user, member, guild } = interaction; await interaction.deferReply(); let result = await eval(code); if (typeof result !== "string") { result = inspect(result); } return interaction.editReply({ embeds: [ { description: `\`\`\`js\n${result}\n\`\`\``, }, ], }); }, }); // Big Long Error D:\Celestine\node_modules\@discordjs\rest\dist\index.js:659 throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData); ^ DiscordAPIError[50001]: Missing Access at SequentialHandler.runRequest (D:\Celestine\node_modules\@discordjs\rest\dist\index.js:659:15) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async SequentialHandler.queueRequest (D:\Celestine\node_modules\@discordjs\rest\dist\index.js:458:14) at async REST.request (D:\Celestine\node_modules\@discordjs\rest\dist\index.js:902:22) { requestBody: { files: undefined, json: [ { name: 'eval', description: 'Eval Some Code', default_member_permissions: undefined, dm_permission: undefined, options: [ { name: 'code', description: 'The code to evaluate', required: true, type: 3 } ], type: 1 } ] }, rawError: { message: 'Missing Access', code: 50001 }, code: 50001, status: 403, method: 'PUT', url: 'https://discord.com/api/v10/applications/1021374807683637249/guilds/1011104283237830800/commands' }