Webhooks
link What is a webhook?
A webhook is a resource that you can create in a text channel that anyone with the URL can use to post messages to the channel. Webhooks are identified by their URL, which is private and required to use the webhook.
Keep your webhook URL private. Anyone with the URL can use it to post messages and there is no way to identify who uses a webhook. Webhooks can sometimes also ping
, making this especially important.link How do I create a webhook?
Go to channel settings and click "Integrations". You should see a "Create Webhook" button. Click it to get a new webhook with a default name and blank profile picture, You can change these if you would like and click "Save". When messages are sent, they will appear with this profile picture and name.
link How do I use a webhook?
In the channel settings tab, click on a webhook to expand it, then click "Copy Webhook URL". Keep this URL private.
Now, you can paste it into an embed utility, execute it manually, use it in a TCN form, etc.
link Advanced Usage
By default, when you execute a webhook, the message will be posted to the channel itself with the webhook's avatar and name. You can actually do a bit more. Note that not all of these features are available with all of the listed services.
- You can edit a message that was sent by the same webhook using the message ID.
- You can post the message to a thread with the thread ID.
- In forum channels, you can create a new post with a specified thread name. Otherwise, you must specify the post ID.
- You can set the avatar and name for a specific message when posting. This overrides the defaults for that message alone. If a webhook sends two
messages in a row with the same username, they merge together like with user messages.
- You cannot edit the avatar or name later on.
link Services
link TCN Embed Tool
https://teyvatcollective.network/tools/embedsThe TCN Embed Tool has an example on the landing page. This is a TOML-based message editor that isn't the most convenient to use but is rigorously defined, allows for a much more readable text representation than raw JSON, and is the basis for autosync templates.
Careful! TCN Embed Tool's share links expire after one week of not being accessed. If you want to keep a permanent link, copy-paste the link from the browser bar and shorten it using something like TinyURL.
link Leaf Embeds
https://embeds.leaf.moeLeaf Embeds does not have any documentation, but you can check out this example for a demo.
Leaf Embeds' save links last forever and have the added bonus of being editable.
link Discohook
https://discohook.orgDiscohook has usage instructions in the landing page.
Careful! Discohook's share links expire after one week. If you want to keep a permanent link, copy-paste the link from the browser bar and shorten it using something like TinyURL.
link Embed Generator
https://message.styleEmbed Generator has its own help page and FAQ on the left sidebar.
link For Developers
A webhook is just an endpoint to which you can send data to make the webhook perform certain actions. You can find full documentation on the Developer Portal, but here is a summary:
POST /
— Provide the message data as the body to post your message through the webhook. Most embed creation services have a JSON editor which allows you to copy the JSON data of your message.- To receive the created message object as a response, set
?wait=true
. - To post to a thread, set
?thread_id=...
. - To create a new forum post, set
"thread_name": "..."
in the request body.
- To receive the created message object as a response, set
PATCH /messages/:id
— Edit a webhook message.DELETE /messages/:id
— Delete a webhook message.PATCH /
— Edit thename
and/oravatar
of the webhook. You cannot change which channel the webhook is in using the method.DELETE /
— Delete the webhook.