Skip to content

DISCORD_TEMPLATE

const DISCORD_TEMPLATE: “{\n\t\“content\”: null,\n\t\“username\”: \“Checkly\”,\n\t\“avatar_url\”: \“https://s3.eu-central-1.amazonaws.com/cdn.checklyhq.com/slack/checkly-slack-icon.png\\",\\n\\t\{\{! Embeds for the SSL expiry notifications}}\n\t{{#eq ALERT_TYPE \“ALERT_SSL\” }}\n\t\“embeds\”: [\n\t\t{\n\t\t\t\“title\”: \“{{ALERT_TITLE}}\”,\n\t\t\t\“url\”: \“{{RESULT_LINK}}\”,\n\t\t\t\“color\”: 16762924\n\t\t}\n\t]\n\t{{else}}\n\t{{! Embeds for the standard failure, recovery and degraded notifications}}\n\t\“embeds\”: [\n\t\t{\n\t\t\t\“title\”: \“{{ALERT_TITLE}}\”,\n\t\t\t\“url\”: \“{{RESULT_LINK}}\”,\n\t\t\t{{! Green for a recovery, red for a failure, amber for anything degraded}}\n\t\t\t\“color\”: {{#eq ALERT_TYPE \“ALERT_RECOVERY\”}}3187820{{else}}{{#eq ALERT_TYPE \“ALERT_DEGRADED_RECOVERY\”}}3187820{{else}}{{#eq ALERT_TYPE \“ALERT_FAILURE\”}}15033421{{else}}16098596{{/eq}}{{/eq}}{{/eq}},\n\t\t\t\“fields\”: [\n\t\t\t\t{{#eq CHECK_TYPE \“API\” }}\n\t\t\t\t{\n\t\t\t\t\t\“name\”: \“Status code\”,\n\t\t\t\t\t\“value\”: \“{{API_CHECK_RESPONSE_STATUS_CODE}}\”\n\t\t\t\t},\n\t\t\t\t{{/eq}}\n\t\t\t\t{{#if GROUP_NAME}}\n\t\t\t\t{\n\t\t\t\t\t\“name\”: \“Group\”,\n\t\t\t\t\t\“value\”: \“{{GROUP_NAME}}\”\n\t\t\t\t},\n\t\t\t\t{{/if}}\n\t\t\t\t{\n\t\t\t\t\t\“name\”: \“Response Time\”,\n\t\t\t\t\t\“value\”: \“{{RESPONSE_TIME}}ms\”\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\“name\”: \“Location\”,\n\t\t\t\t\t\“value\”: \“{{RUN_LOCATION}}\”\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\“name\”: \“Tags\”,\n\t\t\t\t\t\“value\”: \“[{{#each TAGS}} {{this}} {{#unless @last}},{{/unless}} {{/each}}]\”\n\t\t\t\t}\n\t\t\t],\n\t\t\t\“timestamp\”: \“{{STARTED_AT}}\”\n\t\t}\n\t]\n\t{{/eq}}\n}\n”

Defined in: alert-channels/alert-channels.ts:94

The message body of Checkly’s own Discord setup (its AI-analysis section left out, since not every account has it), so a channel made through the API reads like one made in the UI.