Luserrr
Luserrr

Reputation: 29

trying to create a Discord webhook, with the avatar and username assigned inside the code

I am trying to create a Discord webhook, with the avatar and username assigned inside the code.

This is the code I have so far. I have no idea what comes before or after this.

{
  "username": "Webhook",
  "avatar_url": "https://i.imgur.com/4M34hi2.png",
  "content": "Text message. Up to 2000 characters.",
}

Upvotes: 2

Views: 1217

Answers (1)

Tyler Dane
Tyler Dane

Reputation: 1069

Can you instead create the webhook from Discord's GUI (see "Making A Webhook" section)?

If you need to do it programmatically, can you confirm you're sending a POST request to /channels/{channel.id}/webhooks and have the MANAGE_WEBHOOKS role, per the webhook resource? That doc also only shows name and avatar as fields for a create webhook request.

Upvotes: 3

Related Questions