Skip to content

Unable to send Embed Message via API #1992

@immdevrov

Description

@immdevrov

Hello!
I tried to send message with embed object, using the /channels/{channel.id}/messages resourse with my bot

Here is request

curl --location --request POST 'https://discord.com/api/channels/{my channel id}/messages' \
--header 'Authorization: Bot {my-bot-client-id}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "content": "Hello, World!",
  "tts": false,
  "embed": {
    "title": "Hello, Embed!",
    "description": "This is an embedded message."
  }
}'

I got next response:

{
    "id": "746011004495855626",
    "type": 0,
    "content": "Hello, World!",
    "author": {
        "id": "745207529822486568",
        "username": "Juvelir",
        "avatar": null,
        "discriminator": "1829",
        "public_flags": 0,
        "bot": true
    },
    "attachments": [],
    "embeds": [
        {
            "type": "rich",
            "title": "Hello, Embed!",
            "description": "This is an embedded message."
        }
    ],
    "mentions": [],
    "mention_roles": [],
    "pinned": false,
    "mention_everyone": false,
    "tts": false,
    "timestamp": "2020-08-20T14:21:23.686000+00:00",
    "edited_timestamp": null,
    "flags": 0
}

But in Discord the message looks like this:
изображение
So i got the content message string, but didn't get the embed
What i did wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions