bug: TextEmbed not working #35

Closed
opened 2026-02-16 12:26:50 -05:00 by yindo · 2 comments
Owner

Originally created by @kenyonbowers on GitHub (Apr 29, 2024).

What happened?

My code is this:

const embed = new TextEmbed(new MessageEmbed({ title: "Too many verse references!", description: "There are too many verse references in your message." }))

Yet, I keep getting this error:

TypeError: Cannot read properties of undefined (reading 'icon_url')
    at new TextEmbed (D:\Repos\KJV-Bot-Revolt\node_modules\revolt.js\lib\cjs\classes\MessageEmbed.js:166:28)
    at Object.execute (D:\Repos\KJV-Bot-Revolt\src\events\client\messageCreate.js:14:39)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

I have tried putting a value icon_url in the TextEmbed, and even gave a valid image url, yet it keeps giving me the exact same error. I also tried putting it as iconUrl to see if that worked, and it didn't.

Originally created by @kenyonbowers on GitHub (Apr 29, 2024). ### What happened? My code is this: ``` const embed = new TextEmbed(new MessageEmbed({ title: "Too many verse references!", description: "There are too many verse references in your message." })) ``` Yet, I keep getting this error: ``` TypeError: Cannot read properties of undefined (reading 'icon_url') at new TextEmbed (D:\Repos\KJV-Bot-Revolt\node_modules\revolt.js\lib\cjs\classes\MessageEmbed.js:166:28) at Object.execute (D:\Repos\KJV-Bot-Revolt\src\events\client\messageCreate.js:14:39) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) ``` I have tried putting a value `icon_url` in the TextEmbed, and even gave a valid image url, yet it keeps giving me the exact same error. I also tried putting it as `iconUrl` to see if that worked, and it didn't.
yindo added the bug label 2026-02-16 12:26:50 -05:00
yindo closed this issue 2026-02-16 12:26:50 -05:00
Author
Owner

@austinhuang0131 commented on GitHub (Jun 5, 2024):

The icon_url needs to be in the initiator of MessageEmbed. See

https://github.com/revoltchat/revolt.js/blob/929d1bc0696f125748ccd9302b75ee4e8a1a1c8c/src/classes/MessageEmbed.ts#L218

@austinhuang0131 commented on GitHub (Jun 5, 2024): The `icon_url` needs to be in the initiator of MessageEmbed. See https://github.com/revoltchat/revolt.js/blob/929d1bc0696f125748ccd9302b75ee4e8a1a1c8c/src/classes/MessageEmbed.ts#L218
Author
Owner

@insertish commented on GitHub (Oct 2, 2024):

That class expects Client to be present, also this isn't intended for creating embeds (currently), you should just create the structure 'classless' so to speak. i.e. sendMessage({ embeds: [ { .. embed code } ] })

@insertish commented on GitHub (Oct 2, 2024): That class expects Client to be present, also this isn't intended for creating embeds (currently), you should just create the structure 'classless' so to speak. i.e. `sendMessage({ embeds: [ { .. embed code } ] })`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/javascript-client-sdk#35