#TypeError Object prototype may only be an Object or null true

1 messages · Page 1 of 1 (latest)

keen canyon
#

Can you send the errors again?

velvet bane
#

ok

#
/Users/user/Downloads/Discord_Template/node_modules/discord.js/src/util/Util.js:325
    return Object.assign(Object.create(obj), obj);
                                ^

TypeError: Object prototype may only be an Object or null: true
    at Function.create (<anonymous>)
    at Function.cloneObject (/Users/user/Downloads/Discord_Template/node_modules/discord.js/src/util/Util.js:325:33)
    at MessagePayload.resolveData (/Users/user/Downloads/Discord_Template/node_modules/discord.js/src/structures/MessagePayload.js:164:30)
    at TextChannel.send (/Users/user/Downloads/Discord_Template/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:169:32)
    at Message.reply (/Users/user/Downloads/Discord_Template/node_modules/discord.js/src/structures/Message.js:828:25)
    at Timeout._onTimeout (/Users/user/Downloads/Discord_Template/Commands/Test/test.js:29:21)
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7)
velvet bane
keen canyon
#

And which line exactly is line 29?

velvet bane
keen canyon
#

With the string in it?

velvet bane
#

yup

#

even if i use the options

keen canyon
#

Before I dive into the code to see why that error happens exactly, can you just try .reply({ content: "Test Success!" })

#

Should be the same, but

velvet bane
# keen canyon Before I dive into the code to see why that error happens exactly, can you just ...
/Users/user/Downloads/Discord_Template/node_modules/discord.js/src/util/Util.js:325
    return Object.assign(Object.create(obj), obj);
                                ^

TypeError: Object prototype may only be an Object or null: true
    at Function.create (<anonymous>)
    at Function.cloneObject (/Users/user/Downloads/Discord_Template/node_modules/discord.js/src/util/Util.js:325:33)
    at MessagePayload.resolveData (/Users/user/Downloads/Discord_Template/node_modules/discord.js/src/structures/MessagePayload.js:164:30)
    at TextChannel.send (/Users/user/Downloads/Discord_Template/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:169:32)
    at Message.reply (/Users/user/Downloads/Discord_Template/node_modules/discord.js/src/structures/Message.js:828:25)
    at Timeout._onTimeout (/Users/user/Downloads/Discord_Template/Commands/Test/test.js:29:21)
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7)
[nodemon] app crashed - waiting for file changes before starting...
#
setTimeout(() => {
            message.reply({
                content: `Test Successful!`
            });
        },
keen canyon
#

Hmm

#

Can you send your client constructor?

velvet bane
#
/*
    GLOBAL VARIABLES
*/
const {
    Client,
    Intents,
    Collection
} = require(`discord.js`);
const Config = require(`../Assets/Config.json`);
const Util = require("./Utils");

/*
    Client Specific Configuration
*/

let BotIntents = [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_BANS, Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS, Intents.FLAGS.GUILD_INTEGRATIONS, Intents.FLAGS.GUILD_INVITES, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS, Intents.FLAGS.GUILD_MESSAGE_TYPING, Intents.FLAGS.GUILD_PRESENCES, Intents.FLAGS.GUILD_SCHEDULED_EVENTS, Intents.FLAGS.GUILD_VOICE_STATES, Intents.FLAGS.GUILD_WEBHOOKS];
let client = new Client({
    allowedMentions: true,
    intents: BotIntents
});

/*
    Client Collections
*/

client.commands = new Collection();
client.events = new Collection();
client.aliases = new Collection();
client.utils = new Util(client)

/**
 * Client Login Function
 * @param {} Config  
 */
async function init(Config) {

    await client.utils.loadEvents();
    await client.utils.loadCommands();
    await client.login(Config.token);

}

module.exports = {
    init
}
#

thats the client.js file

keen canyon
#

Ah there we go

#

You have allowedMentions: true

#

It should be an object

#

If you want all mentions, just omit it

velvet bane
#

ah must have been a typo

#

made the client file at around 3 am so

keen canyon
#

kek happens

velvet bane
#

ify

#

anyways cheers that works

#

time to update my ranked elo bot, server aio bot, and ptero bot