Problem 1
I just discovered that even though I am installing "discord.js": "^12.1.1", I could see my type definition file was from 11.6.4 for some reason. I manually grabbed the updated one from GitHub.
That resolved my issues creating my MessageEmbed.
Problem 2
CommandMessage.reply would only accept a string as far as I understand, so post this MessageEmbed I believe we have to call CommandMessage.channel.send(), in there I sent my MessageEmbed.
When I test this, a post is made in the channel but it is a string, not an embedded message, and I am receiving this error:
DiscordAPIError: Cannot send an empty message
at /<my_project>/node_modules/@typeit/discord/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15
at /<my_project>/node_modules/snekfetch/src/index.js:215:21
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
name: 'DiscordAPIError',
message: 'Cannot send an empty message',
path: '/api/v7/channels/xxxxxxxxxxxxxxxx/messages',
code: 50006,
method: 'POST'
}
Love the framework š
I was hoping someone might be able to help me out in figuring out how to send a rich text or embedded message.
This appears to be the most up-to-date guide: https://discordjs.guide/popular-topics/embeds.html#embed-preview
Problem 1 I just discovered that even though I am installing
"discord.js": "^12.1.1"
, I could see my type definition file was from 11.6.4 for some reason. I manually grabbed the updated one from GitHub.That resolved my issues creating my
MessageEmbed
.Problem 2
CommandMessage.reply would only accept a string as far as I understand, so post this
MessageEmbed
I believe we have to callCommandMessage.channel.send()
, in there I sent myMessageEmbed
.When I test this, a post is made in the channel but it is a string, not an embedded message, and I am receiving this error:
Answer:
send({embed: MessageEmbed})