Full example:
\nid()\n\nconst embed = {\n title: 'Title',\n color: 5022192,\n description: 'Description',\n timestamp: '2021-12-09T13:32:00.000Z',\n url: 'https://url.url/',\n author: {\n name: 'Author',\n url: 'https://author.url/',\n icon_url: 'https://picsum.photos/200'\n },\n image: {\n url: 'https://picsum.photos/200'\n },\n thumbnail: {\n url: 'https://picsum.photos/50'\n },\n footer: {\n text: 'Footer',\n icon_url: 'https://picsum.photos/20'\n },\n fields: [\n {\n name: 'Field1_key',\n value: 'Field1_value'\n },\n {\n name: 'Field2_key',\n value: 'Field2_value',\n inline: true\n }\n ]\n}\n\nawait api.sendEmbed(cid, embed)\n// or\nawait api.apiCall(`/channels/${cid}/messages`, { embed }, 'POST')
Output:
\n","upvoteCount":2,"url":"https://github.com/rigwild/discord-self-bot-console/discussions/6#discussioncomment-1779730"}}}-
Can you write how to send embed? Let others benefit as well. Note: I just edit, nothing new. |
Beta Was this translation helpful? Give feedback.
-
EDIT: SENDING EMBEDS AS A USER ACCOUNT IS NOT POSSIBLE ANYMORE, DISCORD UPDATED ITS API (see this reddit post) Looks like the issue is the color, you need to send an integer (see https://discord.com/developers/docs/resources/channel#embed-object-embed-structure). I found this nice embed generator online. Click I updated the API to accept a full embed (f9d15bd). api = {
sendEmbed: (channelId, embed = { title: 'Title', description: 'Description' }) => apiCall(`/channels/${channelId}/messages`, { embed }, 'POST')
} Full example: id()
const embed = {
title: 'Title',
color: 5022192,
description: 'Description',
timestamp: '2021-12-09T13:32:00.000Z',
url: 'https://url.url/',
author: {
name: 'Author',
url: 'https://author.url/',
icon_url: 'https://picsum.photos/200'
},
image: {
url: 'https://picsum.photos/200'
},
thumbnail: {
url: 'https://picsum.photos/50'
},
footer: {
text: 'Footer',
icon_url: 'https://picsum.photos/20'
},
fields: [
{
name: 'Field1_key',
value: 'Field1_value'
},
{
name: 'Field2_key',
value: 'Field2_value',
inline: true
}
]
}
await api.sendEmbed(cid, embed)
// or
await api.apiCall(`/channels/${cid}/messages`, { embed }, 'POST') Output: |
Beta Was this translation helpful? Give feedback.
-
Yes, Discord updated its API but still you can send embeds. How? Let's explain. I found a embed generator that can give an customizable embed url. When u send it to Discord u can see your embed message. The Generator Website: https://embedl.ink/ You can customize your embed with GET parameters like this: https://embedl.ink/?deg&provider=&providerurl=&author=&authorurl=&title=&color=%23000000&media=none&mediaurl=&desc= |
Beta Was this translation helpful? Give feedback.
EDIT:
SENDING EMBEDS AS A USER ACCOUNT IS NOT POSSIBLE ANYMORE, DISCORD UPDATED ITS API (see this reddit post)
Looks like the issue is the color, you need to send an integer (see https://discord.com/developers/docs/resources/channel#embed-object-embed-structure).
I found this nice embed generator online. Click
+
at the bottom in the embed section then copy theembed
key in the JSON output.https://discord.club/dashboard
I updated the API to accept a full embed (f9d15bd).
Full example: