Chili
Chili
DIAdiscord.js - Imagine an app
Created by Chili on 5/29/2024 in #djs-questions
EmbedBuilder sends an empty message
I'm trying to send an embed using the interaction.editReply() way. However when I execute the command I get an error DiscordAPIError[50006]: Cannot send an empty message.
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder } = require('discord.js');

async function createLobby(interaction, options) {
await interaction.deferReply({ ephemeral: true});

const size = options.get('size').value;
const name = options.get('name').value;
const description = options.get('description') ? options.get('description').value : 'No description provided.';
let color = 0x17fc03;
const footerObject = {
text: 'Initiated by ' + interaction.user.username,
icon_url: interaction.user.avatarURL()
}

const lobbyEmbed = new EmbedBuilder()
.setColor(color)
.setTitle(name)
.setDescription(description)
.addFields(
{ name: 'Lobby Size', value: size, inline: false },
)
.setTimestamp()
.setFooter(footerObject);

interaction.editReply({ embed: [lobbyEmbed], ephemeral: true });
}

module.exports = createLobby;
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder } = require('discord.js');

async function createLobby(interaction, options) {
await interaction.deferReply({ ephemeral: true});

const size = options.get('size').value;
const name = options.get('name').value;
const description = options.get('description') ? options.get('description').value : 'No description provided.';
let color = 0x17fc03;
const footerObject = {
text: 'Initiated by ' + interaction.user.username,
icon_url: interaction.user.avatarURL()
}

const lobbyEmbed = new EmbedBuilder()
.setColor(color)
.setTitle(name)
.setDescription(description)
.addFields(
{ name: 'Lobby Size', value: size, inline: false },
)
.setTimestamp()
.setFooter(footerObject);

interaction.editReply({ embed: [lobbyEmbed], ephemeral: true });
}

module.exports = createLobby;
I'm not sure if in this new version this technique still works the same way as in 14.14.x. Do I need to send it, and not edit the reply? Thanks for the help in advance!
6 replies