#TypeError Object prototype may only be an Object or null true
1 messages · Page 1 of 1 (latest)
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)
weirdly enough it doesnt matter if its a reply or a channel.send it still sends the same error
And which line exactly is line 29?
message.reply()
With the string in it?
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
/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!`
});
},
/*
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
Ah there we go
You have allowedMentions: true
It should be an object
If you want all mentions, just omit it
happens
