Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I keep receiving an empty message error when trying to post a webhook

This is my first time using Discord embeds, let alone, making a webhook. Having a little bit of trouble trying to figure out what I'm doing wrong. Hopefully someone can help!

When I try to send an embed with a message with this code:

{
  "username": "Official Discord Servers",
  "avatar_url": "https://imgur.com/a/Cl3zspb",
  "embeds": [{
    "description": "Here is a list of official Discord servers maintained by our State. Note that most of these servers may restrict full access to those who are members of their respective departments:",
    "color": 16007990,
    "fields": [
      {
        "name": "State of Atoll",
        "value": "[Discord Server](https://discord.gg/5KKgb2z)"
      },
      {
        "name": "Atoll Law Enforcement Training Academy",
        "value": "[Discord Server](https://discord.gg/GJnbavz)"
      },
      {
        "name": "Atoll Department of Homeland Security",
        "value": "[Discord Server](https://discord.gg/acnPFa7)"
      },
      {
        "name": "Palm County Sheriff's Office",
        "value": "[Discord Server](https://discord.gg/uYFANDs)"
      },
      {
        "name": "Atoll State Police",
        "value": "[Discord Server](https://discord.gg/WNHKtra)"
      },
      {
        "name": "Atoll Department of Corrections",
        "value": "[Discord Server](https://discord.gg/VbFew9s)"
      },
      {
        "name": "Atoll National Guard",
        "value": "[Discord Server](https://discord.gg/6zE9HyW)"
  }]
}

I get this error:

{ "code": 50006, "message": "Cannot send an empty message" }

like image 450
Abby W Avatar asked Feb 26 '19 06:02

Abby W


1 Answers

You need to send "content" as a key value pair containing the content of the message being sent.

"content": "Just testing webhooks"
like image 104
Ghonima Avatar answered Sep 28 '22 12:09

Ghonima