Hosfad
Hosfad
DIAdiscord.js - Imagine an app
Created by Hosfad on 5/30/2024 in #djs-questions
TextChannel.send only works when sending raw content
Hello , i am fetching a channel and trying to send an embed, and it doesnt work, it only allows me to send a channel when i remove the embed and send raw String content. Here is the code , i have added an example of what works and what doesnt work :
const channel = (await DiscordClient.channels.fetch(
ChannelIds.REVIEWS_CHANNEL
)) as TextChannel;
// this works and sends the message
await channel.send({ content: "message" });

//embed
const embed = new EmbedBuilder()
.setDescription(`**Message:**`)
.setTitle("Review");

// this doesnt work (gets stuck on the await and never prints)
await channel.send({ content: "message", embeds: [embed] });
const channel = (await DiscordClient.channels.fetch(
ChannelIds.REVIEWS_CHANNEL
)) as TextChannel;
// this works and sends the message
await channel.send({ content: "message" });

//embed
const embed = new EmbedBuilder()
.setDescription(`**Message:**`)
.setTitle("Review");

// this doesnt work (gets stuck on the await and never prints)
await channel.send({ content: "message", embeds: [embed] });
Any ideas on why could that be ? Thanks in advance. I am using Discordjs 14.6.0
27 replies