How to send embed messages ? #11
Unanswered
fazlulShanto
asked this question in
Q&A
Replies: 1 comment
-
Hi, thanks so much for reaching out. Embeds need to get passed as an array, as described in the documentation. hook.send("test",[embed]).then(res=>{
console.log(res)
}) Please mark this as solved if that helped ^^ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i tired in this way:
const url = require('./config.json').url;
const {Webhook} = require('simple-discord-webhooks');
const hook = new Webhook(url);
const embed = {
color: 16711935,
title: 'Hello World!',
fields: [ { name: 'title', value: 'vaule', inline: false } ],
description: 'Unable to find a readme for discord-raw'
};
hook.send("test",embed).then(res=>{
console.log(res)
})
this is the error I am getting :
H:\Dev\recruitment\node_modules\simple-discord-webhooks\dist\Webhook.js:66
throw new WebhookError_1.WebhookError(JSON.parse(res.body.toString()));
^
Webhook [Error]
at Webhook. (H:\Dev\recruitment\node_modules\simple-discord-webhooks\dist\Webhook.js:66:23)
at Generator.next ()
at fulfilled (H:\Dev\recruitment\node_modules\simple-discord-webhooks\dist\Webhook.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: undefined
}
Node.js v18.7.0
Beta Was this translation helpful? Give feedback.
All reactions