aboutsummaryrefslogtreecommitdiffstats
path: root/SCHEMA.md
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2020-12-21 04:41:27 +0300
committerGravatar Hassan Abouelela <[email protected]>2020-12-21 04:41:27 +0300
commit9d8ca77b1f18891cef88e9b8235b41172067f9b0 (patch)
tree4f9ba4026002a9e69b916bb73c9aa9fce02cf758 /SCHEMA.md
parentAdds Missing Annotation (diff)
Adds and Documents Webhook Message Variables
Adds better parsing and formatting for webhook message variables, and documents them in SCHEMA.md. Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'SCHEMA.md')
-rw-r--r--SCHEMA.md18
1 files changed, 15 insertions, 3 deletions
diff --git a/SCHEMA.md b/SCHEMA.md
index b55635f..fa5f247 100644
--- a/SCHEMA.md
+++ b/SCHEMA.md
@@ -33,9 +33,21 @@ In this document:
| `WEBHOOK_ENABLED` | The form should notify the webhook. Has no effect if no webhook is set. |
### Meta options
-| Field | Description | Example |
-| --------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
-| `webhook` | Mapping of webhook url and message. Message can use `_USER_MENTION_` to mention the submitting user. | `"webhook": {"url": "https://discord.com/api/webhooks/id/key", "message": "Hello World! _USER_MENTION_"}` |
+| Field | Description | Example |
+| --------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
+| `webhook` | Mapping of webhook url and message. Message can use certain [context variables](#webhook-variables). | `"webhook": {"url": "https://discord.com/api/webhooks/id/key", "message": "{user} submitted a form."}` |
+
+
+#### Webhook Variables
+The following variables can be used in a webhook's message. The variables must be wrapped by braces (`{}`).
+
+| Name | Description |
+| ------------- | ---------------------------------------------------------------------------- |
+| `user` | A discord mention of the user submitting the form, or "User" if unavailable. |
+| `response_id` | ID of the submitted response. |
+| `form` | Name of the submitted form. |
+| `form_id` | ID of the submitted form. |
+| `time` | ISO submission timestamp. |
### Form question