Skip to content

Commit 54baff9

Browse files
authored
Create format-as-code.js
Signed-off-by: Kim Brose <[email protected]>
1 parent 5459ccd commit 54baff9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This snippet will receive a webhook containing `text`, e.g. Slack Webhook format and dump it into a codeblock.
2+
// This is useful for hooks which contain monospace-formatted info, for example logs or ZFS event daemon (https://openzfs.github.io/openzfs-docs/man/master/8/zed.8.html) notifications.
3+
4+
result = {
5+
plain: `\`\`\`\n${data.text}\n\`\`\``,
6+
version: "v2"
7+
};

0 commit comments

Comments
 (0)