discord
This commit is contained in:
1 parent
be82a7ee2d
commit
9006707e57
2 files changed
+6
-8
No files matched your search
@@ -21,8 +21,6 @@ export class DiscordProvider implements INotificationProvider {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log({ body });
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await got.post(notification.address, {
|
await got.post(notification.address, {
|
||||||
json: body,
|
json: body,
|
||||||
|
|||||||
@@ -176,14 +176,14 @@ export const buildDiscordBody = (monitor: Monitor, monitorStatusResponse: Monito
|
|||||||
let body = {
|
let body = {
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
title: `Monitor ${monitor.name}`,
|
title: `Monitor name: ${monitor.name}`,
|
||||||
color: monitor.status ? 5763719 : 15548997,
|
color: monitorStatusResponse.status ? 5763719 : 15548997,
|
||||||
|
|
||||||
fields: [
|
fields: [
|
||||||
{ name: "Monitor", value: monitor.name, inline: true },
|
{ name: "Monitor", value: monitor.name, inline: false },
|
||||||
{ name: "Status", value: monitor.status ? "Up" : "Down", inline: true },
|
{ name: "Status", value: monitorStatusResponse.status ? "Up" : "Down", inline: false },
|
||||||
{ name: "Status Code", value: String(monitorStatusResponse.code), inline: true },
|
{ name: "Status Code", value: String(monitorStatusResponse.code), inline: false },
|
||||||
{ name: "Time", value: `${localTime} (Local) / ${utcTime} (UTC)`, inline: true },
|
{ name: "Time", value: `${localTime} (Local) / ${utcTime} (UTC)`, inline: false },
|
||||||
{ name: "URL", value: monitor.url, inline: false },
|
{ name: "URL", value: monitor.url, inline: false },
|
||||||
],
|
],
|
||||||
footer: { text: "Checkmate" },
|
footer: { text: "Checkmate" },
|
||||||
|
|||||||
Reference in new issue
Block a user