Skip to content
\n

Full example:

\n
id()\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')
\n

Output:

\n

\"embed

","upvoteCount":2,"url":"https://github.com/rigwild/discord-self-bot-console/discussions/6#discussioncomment-1779730"}}}

How to send an Embed? #6

Answered by rigwild
DeadLyBro asked this question in Q&A
Dec 9, 2021 · 2 comments · 7 replies
Discussion options

You must be logged in to vote

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 the embed key in the JSON output.
https://discord.club/dashboard

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: 5…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
4 replies
@DeadLyBro
Comment options

@DeadLyBro
Comment options

@rigwild
Comment options

@bariscodefxy
Comment options

Answer selected by rigwild
Comment options

You must be logged in to vote
3 replies
@rigwild
Comment options

@DeadLyBro
Comment options

@bariscodefxy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants