DEV Community

Discussion on: Send automated Discord messages through Webhooks using JavaScript (Part 2 - Embeds)

 
pealco821103 profile image
Pedro Costa • Edited

Hello @oskarcodes I found the issue.

We can't use color: hexToDecimal("#ff0000"), instead we have to use decimal code so just change color: hexToDecimal("#ff0000") with color : 16711680

Probably you have other script to execute that hexToDecimal command.

Hope it helps

Thread Thread
 
oskarcodes profile image
Oskar Codes

Oh well yeah the hexTodecimal function is just this:

function hexToDecimal(hex) {
  return parseInt(hex.replace("#",""), 16)
}