Skip to content

Commit

Permalink
Custom embed username
Browse files Browse the repository at this point in the history
  • Loading branch information
NiNiyas authored Aug 7, 2021
1 parent 91fce75 commit ebf207c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Notification {
// If heartbeatJSON is null, assume we're testing.
if (heartbeatJSON == null) {
let discordtestdata = {
username: "Uptime Kuma",
username: notification.discordUsername || "Uptime Kuma",
content: msg,
}
await axios.post(notification.discordWebhookUrl, discordtestdata)
Expand All @@ -96,7 +96,7 @@ class Notification {
// If heartbeatJSON is not null, we go into the normal alerting loop.
if (heartbeatJSON["status"] == 0) {
let discorddowndata = {
username: "Uptime Kuma",
username: notification.discordUsername || "Uptime Kuma",
embeds: [{
title: "❌ One of your services went down. ❌",
color: 16711680,
Expand Down Expand Up @@ -126,7 +126,7 @@ class Notification {

} else if (heartbeatJSON["status"] == 1) {
let discordupdata = {
username: "Uptime Kuma",
username: notification.discordUsername || "Uptime Kuma",
embeds: [{
title: "✅ Your service " + monitorJSON["name"] + " is up! ✅",
color: 65280,
Expand Down

0 comments on commit ebf207c

Please sign in to comment.