//// Error E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\rest\RequestHandler.js:298 throw new DiscordAPIError(data, res.status, request); ^ DiscordAPIError: Cannot send an empty message at RequestHandler.execute (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\rest\RequestHandler.js:298:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\rest\RequestHandler.js:50:14) at async TextChannel.send (E:\C) Developing\Wolfy Djs-13\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:171:15) { method: 'post', path: '/channels/805088270756872214/messages', code: 50006, httpStatus: 400, requestData: { json: { content: undefined, tts: false, nonce: undefined, embeds: undefined, components: undefined, username: undefined, avatar_url: undefined, allowed_mentions: undefined, flags: undefined, message_reference: undefined, attachments: undefined, sticker_ids: undefined }, files: [] } } /// Code const parser = require('../../util/greeter/parser'); const errors = require('../../util/greeter/errors'); const success = require('../../util/greeter/success'); stats = stats.toLowerCase(); const type = 'Member Greeter'; const source = 'https://wolfy.yoyojoe.repl.co/'; const variables = { '%TYPE': 'welcome', '%ACTION': 'joins', '%PREFIX': prefix, '%COMMAND': 'setwelcomemsg', '%STATE': 'Incoming', '%TITLE': 'Member Greeter' }; if (stats === 'msg=') { if (!data.greeter.welcome.message){ return parser.error(message, { type, source, title: parser.parseMessage(errors.NO_TEXT_MESSAGE.title, variables), subtitle: parser.parseMessage(errors.NO_TEXT_MESSAGE.subtitle, variables) }); } else { doc.greeter.welcome.type = 'msg'; return parser.saveDocument(data, message, { type, source, title: parser.parseMessage(success.TYPE_IS_MESSAGE.title, variables), subtitle: parser.parseMessage(success.TYPE_IS_MESSAGE.title, variables) }).then(() => { data.greeter.welcome.type = 'msg'; message.channel.send({ content: `set the new message to: ${message}`}) data.save() }).catch(() => { return sendError(message); }); } }