#ExperimentalWarning

20 messages · Page 1 of 1 (latest)

long fjordBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

humble fjord
#

"discord.js": "^13.6.0"

#
(node:300) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Server is ready!
DiscordAPIError[50035]: Invalid Form Body
application_id[NUMBER_TYPE_COERCE]: Value "undefined" is not snowflake.
    at SequentialHandler.runRequest (/home/runner/FlyingDutchmanNetworkMail-Bot/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.cjs:287:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (/home/runner/FlyingDutchmanNetworkMail-Bot/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.cjs:99:14)
    at async REST.request (/home/runner/FlyingDutchmanNetworkMail-Bot/node_modules/@discordjs/rest/dist/lib/REST.cjs:52:22) {
  rawError: {
    code: 50035,
    errors: { application_id: [Object] },
    message: 'Invalid Form Body'
  },
  code: 50035,
  status: 400,
  method: 'PUT',
  url: 'https://discord.com/api/v9/applications/undefined/guilds/895026441194975263/commands',
  requestBody: {
    files: undefined,
    json: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object]
    ]
  }
}
#

Maybe something I forgot to change... I'm not sure.

#

I might have to update discord.js, but Replit does that automatically for me, but now it doesn't because it errors.

surreal egret
humble fjord
#

No I did not.

surreal egret
#

weird

humble fjord
#
// Keep Alive
const KeepAlive = require("./server")

// The Bot
const Discord = require("discord.js")
const {
    Intents
} = require("discord.js")
const {
    REST
} = require('@discordjs/rest')
const {
    Routes
} = require('discord-api-types/v9')
const Config = require("./config.json")
const fs = require("node:fs")

const client = new Discord.Client({
    intents: [
        Intents.FLAGS.GUILDS,
        Intents.FLAGS.GUILD_MEMBERS,
        Intents.FLAGS.GUILD_BANS,
        Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
        Intents.FLAGS.GUILD_VOICE_STATES,
        Intents.FLAGS.GUILD_MESSAGES,
        Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
        Intents.FLAGS.DIRECT_MESSAGES
    ],
    partials: ['USER', 'CHANNEL', 'GUILD_MEMBER', 'MESSAGE']
})

// Command Handling
client.commands = new Discord.Collection()

fs.readdirSync('./Events').forEach(dirs => {
    const EventFiles = fs.readdirSync(`./Events/${dirs}`)
        .filter(file =>
            file.endsWith('.js')
        )

    for (const file of EventFiles) {
        const EventName = file.split(".")[0]
        const Event = require(`./Events/${dirs}/${file}`)
        client.on(EventName, Event.bind(null, client))
    }
})

const commands = [];

fs.readdirSync('./Commands').forEach(dirs => {
    const CommandFiles = fs.readdirSync(`./Commands/${dirs}`)
        .filter(file =>
            file.endsWith('.js')
        )

    for (const file of CommandFiles) {
        const command = require(`./Commands/${dirs}/${file}`)
        commands.push(command.data.toJSON())
        client.commands.set(command.data.name, command)
    }
})

const rest = new REST({
    version: '9'
}).setToken(Config.Token);

(async () => {
    try {
        console.log('Started refreshing application (/) commands.');

        await rest.put(
            Routes.applicationGuildCommands(Config.ClientID, Config.GuildID), {
                body: commands
            },
        );

        console.log('Successfully reloaded application (/) commands.');
    } catch (error) {
        console.error(error);
    }
})();

client.on("ready", () => {
    client.user.setPresence({
        activities: [{
            name: `met het laadscherm...`,
            type: "PLAYING"
        }],
        status: 'dnd'
    });

    setTimeout(() => {
        client.user.setPresence({
            activities: [{
                name: `inkomende tickets`,
                type: "WATCHING"
            }],
            status: 'online'
        })
    }, 30_000)

    console.log(`Client ready; logged in as ${client.user.username}#${client.user.discriminator} (${client.user.id})`);
})

KeepAlive()
client.login(Config.Token).catch(console.error)
#

Oh wait.

#

I see the issue I guess.

#

Config.ClientID isn't a thing 🤣

#

Sorry. Thanks anyways!

#

@surreal egret That isn't the issue I see now.

surreal egret
#

Also the experimental warning that's a problem with replit

humble fjord
#

No it isn't.

#

It's because the bot doesn't has application.commands enabled 🤣

surreal egret
#

no

humble fjord
#

Oh wait, now I see. It's not something related to the bot sweatyface

#

But the issue that he can't make slash commands, is an issue... But that's up to the bot owner 🙂