From fe2de6b89959117a750aede8e1c7111c8347fc3c Mon Sep 17 00:00:00 2001 From: Nicholas Penree Date: Tue, 17 Dec 2024 22:03:58 -0500 Subject: [PATCH] feat(discord): remove dots --- .../src/utils/notifications/build-error.ts | 20 +++++++++---------- .../src/utils/notifications/build-success.ts | 18 ++++++++--------- .../utils/notifications/database-backup.ts | 20 +++++++++---------- .../src/utils/notifications/docker-cleanup.ts | 12 +++++------ .../utils/notifications/dokploy-restart.ts | 10 +++++----- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/packages/server/src/utils/notifications/build-error.ts b/packages/server/src/utils/notifications/build-error.ts index 5406698d..f9286fc7 100644 --- a/packages/server/src/utils/notifications/build-error.ts +++ b/packages/server/src/utils/notifications/build-error.ts @@ -28,7 +28,7 @@ export const sendBuildErrorNotifications = async ({ adminId, }: Props) => { const date = new Date(); - const unixDate = ~~((Number(date)) / 1000); + const unixDate = ~~(Number(date) / 1000); const notificationList = await db.query.notifications.findMany({ where: and( eq(notifications.appBuildError, true), @@ -60,45 +60,45 @@ export const sendBuildErrorNotifications = async ({ if (discord) { await sendDiscordNotification(discord, { - title: "> `⚠️` - Build Failed", + title: "> `⚠️` Build Failed", color: 0xed4245, fields: [ { - name: "`🛠️`・Project", + name: "`🛠️` Project", value: projectName, inline: true, }, { - name: "`⚙️`・Application", + name: "`⚙️` Application", value: applicationName, inline: true, }, { - name: "`❔`・Type", + name: "`❔` Type", value: applicationType, inline: true, }, { - name: "`📅`・Date", + name: "`📅` Date", value: ``, inline: true, }, { - name: "`⌚`・Time", + name: "`⌚` Time", value: ``, inline: true, }, { - name: "`❓`・Type", + name: "`❓`Type", value: "Failed", inline: true, }, { - name: "`⚠️`・Error Message", + name: "`⚠️` Error Message", value: `\`\`\`${errorMessage}\`\`\``, }, { - name: "`🧷`・Build Link", + name: "`🧷` Build Link", value: `[Click here to access build link](${buildLink})`, }, ], diff --git a/packages/server/src/utils/notifications/build-success.ts b/packages/server/src/utils/notifications/build-success.ts index 1c16b10d..97fe7e1c 100644 --- a/packages/server/src/utils/notifications/build-success.ts +++ b/packages/server/src/utils/notifications/build-success.ts @@ -26,7 +26,7 @@ export const sendBuildSuccessNotifications = async ({ adminId, }: Props) => { const date = new Date(); - const unixDate = ~~((Number(date)) / 1000); + const unixDate = ~~(Number(date) / 1000); const notificationList = await db.query.notifications.findMany({ where: and( eq(notifications.appDeploy, true), @@ -58,41 +58,41 @@ export const sendBuildSuccessNotifications = async ({ if (discord) { await sendDiscordNotification(discord, { - title: "> `✅` - Build Success", + title: "> `✅` Build Success", color: 0x57f287, fields: [ { - name: "`🛠️`・Project", + name: "`🛠️` Project", value: projectName, inline: true, }, { - name: "`⚙️`・Application", + name: "`⚙️` Application", value: applicationName, inline: true, }, { - name: "`❔`・Application Type", + name: "`❔` Application Type", value: applicationType, inline: true, }, { - name: "`📅`・Date", + name: "`📅` Date", value: ``, inline: true, }, { - name: "`⌚`・Time", + name: "`⌚` Time", value: ``, inline: true, }, { - name: "`❓`・Type", + name: "`❓` Type", value: "Successful", inline: true, }, { - name: "`🧷`・Build Link", + name: "`🧷` Build Link", value: `[Click here to access build link](${buildLink})`, }, ], diff --git a/packages/server/src/utils/notifications/database-backup.ts b/packages/server/src/utils/notifications/database-backup.ts index 6d3dcb28..d2dccdaf 100644 --- a/packages/server/src/utils/notifications/database-backup.ts +++ b/packages/server/src/utils/notifications/database-backup.ts @@ -26,7 +26,7 @@ export const sendDatabaseBackupNotifications = async ({ errorMessage?: string; }) => { const date = new Date(); - const unixDate = ~~((Number(date)) / 1000); + const unixDate = ~~(Number(date) / 1000); const notificationList = await db.query.notifications.findMany({ where: and( eq(notifications.databaseBackup, true), @@ -65,37 +65,37 @@ export const sendDatabaseBackupNotifications = async ({ await sendDiscordNotification(discord, { title: type === "success" - ? "> `✅` - Database Backup Successful" - : "> `❌` - Database Backup Failed", + ? "> `✅` Database Backup Successful" + : "> `❌` Database Backup Failed", color: type === "success" ? 0x57f287 : 0xed4245, fields: [ { - name: "`🛠️`・Project", + name: "`🛠️` Project", value: projectName, inline: true, }, { - name: "`⚙️`・Application", + name: "`⚙️` Application", value: applicationName, inline: true, }, { - name: "`❔`・Database", + name: "`❔` Database", value: databaseType, inline: true, }, { - name: "`📅`・Date", + name: "`📅` Date", value: ``, inline: true, }, { - name: "`⌚`・Time", + name: "`⌚` Time", value: ``, inline: true, }, { - name: "`❓`・Type", + name: "`❓` Type", value: type .replace("error", "Failed") .replace("success", "Successful"), @@ -104,7 +104,7 @@ export const sendDatabaseBackupNotifications = async ({ ...(type === "error" && errorMessage ? [ { - name: "`⚠️`・Error Message", + name: "`⚠️` Error Message", value: `\`\`\`${errorMessage}\`\`\``, }, ] diff --git a/packages/server/src/utils/notifications/docker-cleanup.ts b/packages/server/src/utils/notifications/docker-cleanup.ts index 7a836329..515d1ddc 100644 --- a/packages/server/src/utils/notifications/docker-cleanup.ts +++ b/packages/server/src/utils/notifications/docker-cleanup.ts @@ -15,7 +15,7 @@ export const sendDockerCleanupNotifications = async ( message = "Docker cleanup for dokploy", ) => { const date = new Date(); - const unixDate = ~~((Number(date)) / 1000); + const unixDate = ~~(Number(date) / 1000); const notificationList = await db.query.notifications.findMany({ where: and( eq(notifications.dockerCleanup, true), @@ -46,26 +46,26 @@ export const sendDockerCleanupNotifications = async ( if (discord) { await sendDiscordNotification(discord, { - title: "> `✅` - Docker Cleanup", + title: "> `✅` Docker Cleanup", color: 0x57f287, fields: [ { - name: "`📅`・Date", + name: "`📅` Date", value: ``, inline: true, }, { - name: "`⌚`・Time", + name: "`⌚` Time", value: ``, inline: true, }, { - name: "`❓`・Type", + name: "`❓` Type", value: "Successful", inline: true, }, { - name: "`📜`・Message", + name: "`📜` Message", value: `\`\`\`${message}\`\`\``, }, ], diff --git a/packages/server/src/utils/notifications/dokploy-restart.ts b/packages/server/src/utils/notifications/dokploy-restart.ts index 86cd6f03..883a3d1f 100644 --- a/packages/server/src/utils/notifications/dokploy-restart.ts +++ b/packages/server/src/utils/notifications/dokploy-restart.ts @@ -12,7 +12,7 @@ import { export const sendDokployRestartNotifications = async () => { const date = new Date(); - const unixDate = ~~((Number(date)) / 1000); + const unixDate = ~~(Number(date) / 1000); const notificationList = await db.query.notifications.findMany({ where: eq(notifications.dokployRestart, true), with: { @@ -35,21 +35,21 @@ export const sendDokployRestartNotifications = async () => { if (discord) { await sendDiscordNotification(discord, { - title: "> `✅` - Dokploy Server Restarted", + title: "> `✅` Dokploy Server Restarted", color: 0x57f287, fields: [ { - name: "`📅`・Date", + name: "`📅` Date", value: ``, inline: true, }, { - name: "`⌚`・Time", + name: "`⌚` Time", value: ``, inline: true, }, { - name: "`❓`・Type", + name: "`❓` Type", value: "Successful", inline: true, },