embeds[0].description[BASE_TYPE_REQUIRED]: This field is required V14

const banEmbed = { "content": "", "tts": false, "embeds": [ { "title": banCaseCounter + | UNBAN | ${targetUserTag}, "description": "User has been banned.",
"color": 2326507, "fields": [
3 Replies
d.js toolkit
d.js toolkit16mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
mallusrgreat
mallusrgreat16mo ago
full code
Osman
OsmanOP16mo ago
Full error : There was an error when banning: DiscordAPIError[50035]: Invalid Form Body embeds[0].description[BASE_TYPE_REQUIRED]: This field is required
const banEmbed = {
"content": "",
"tts": false,
"embeds": [
{
"title": banCaseCounter + ` | BAN | ${targetUserTag}`,
"description": "User has been banned.",
"color": 2326507,
"fields": [
{
"name": "User",
"value": targetUserTag,
"inline": true
},
{
"name": "Moderator",
"value": interaction.user.tag,
"inline": true
},
{
"name": "Reason",
"value": reason,
"inline": true
}
],
"footer": {
"text": `ID: ${targetUserId}`,
},
"timestamp": new Date()
}
],
"components": [],
"actions": {}
};
const banEmbed = {
"content": "",
"tts": false,
"embeds": [
{
"title": banCaseCounter + ` | BAN | ${targetUserTag}`,
"description": "User has been banned.",
"color": 2326507,
"fields": [
{
"name": "User",
"value": targetUserTag,
"inline": true
},
{
"name": "Moderator",
"value": interaction.user.tag,
"inline": true
},
{
"name": "Reason",
"value": reason,
"inline": true
}
],
"footer": {
"text": `ID: ${targetUserId}`,
},
"timestamp": new Date()
}
],
"components": [],
"actions": {}
};
stack trace?
There was an error when banning: DiscordAPIError[50035]: Invalid Form Body
embeds[0].description[BASE_TYPE_REQUIRED]: This field is required
There was an error when banning: DiscordAPIError[50035]: Invalid Form Body
embeds[0].description[BASE_TYPE_REQUIRED]: This field is required
Is all I get. How can I "improve" my error logging?
embeds[0].description[BASE_TYPE_REQUIRED]: This field is required
at handleErrors (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\node_modules\@discordjs\rest\dist\index.js:687:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\node_modules\@discordjs\rest\dist\index.js:1072:23)
at async SequentialHandler.queueRequest (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\node_modules\@discordjs\rest\dist\index.js:913:14)
at async _REST.request (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\node_modules\@discordjs\rest\dist\index.js:1218:22)
at async TextChannel.send (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:162:15)
at async Object.callback (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\src\commands\moderation\ban.js:111:15)
at async module.exports (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\src\events\interactionCreate\handleCommands.js:62:5)
at async Client.<anonymous> (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\src\handlers\eventHandler.js:16:9) {
requestBody: {
files: [],
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: [Array],
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { embeds: [Object] }
},
code: 50035,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1147844987371913286/messages'
}
embeds[0].description[BASE_TYPE_REQUIRED]: This field is required
at handleErrors (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\node_modules\@discordjs\rest\dist\index.js:687:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\node_modules\@discordjs\rest\dist\index.js:1072:23)
at async SequentialHandler.queueRequest (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\node_modules\@discordjs\rest\dist\index.js:913:14)
at async _REST.request (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\node_modules\@discordjs\rest\dist\index.js:1218:22)
at async TextChannel.send (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:162:15)
at async Object.callback (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\src\commands\moderation\ban.js:111:15)
at async module.exports (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\src\events\interactionCreate\handleCommands.js:62:5)
at async Client.<anonymous> (C:\Users\Odin\Documents\GitHub\HeeSanDiscordJS\src\handlers\eventHandler.js:16:9) {
requestBody: {
files: [],
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: [Array],
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { embeds: [Object] }
},
code: 50035,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1147844987371913286/messages'
}
Want results from more Discord servers?
Add your server