feat(discord): remove dots

This commit is contained in:
Nicholas Penree
2024-12-17 22:03:58 -05:00
parent 829aa2a63c
commit fe2de6b899
5 changed files with 40 additions and 40 deletions

View File

@@ -28,7 +28,7 @@ export const sendBuildErrorNotifications = async ({
adminId, adminId,
}: Props) => { }: Props) => {
const date = new Date(); const date = new Date();
const unixDate = ~~((Number(date)) / 1000); const unixDate = ~~(Number(date) / 1000);
const notificationList = await db.query.notifications.findMany({ const notificationList = await db.query.notifications.findMany({
where: and( where: and(
eq(notifications.appBuildError, true), eq(notifications.appBuildError, true),
@@ -60,45 +60,45 @@ export const sendBuildErrorNotifications = async ({
if (discord) { if (discord) {
await sendDiscordNotification(discord, { await sendDiscordNotification(discord, {
title: "> `⚠️` - Build Failed", title: "> `⚠️` Build Failed",
color: 0xed4245, color: 0xed4245,
fields: [ fields: [
{ {
name: "`🛠️`Project", name: "`🛠️` Project",
value: projectName, value: projectName,
inline: true, inline: true,
}, },
{ {
name: "`⚙️`Application", name: "`⚙️` Application",
value: applicationName, value: applicationName,
inline: true, inline: true,
}, },
{ {
name: "`❔`Type", name: "`❔` Type",
value: applicationType, value: applicationType,
inline: true, inline: true,
}, },
{ {
name: "`📅`Date", name: "`📅` Date",
value: `<t:${unixDate}:D>`, value: `<t:${unixDate}:D>`,
inline: true, inline: true,
}, },
{ {
name: "`⌚`Time", name: "`⌚` Time",
value: `<t:${unixDate}:t>`, value: `<t:${unixDate}:t>`,
inline: true, inline: true,
}, },
{ {
name: "`❓`Type", name: "`❓`Type",
value: "Failed", value: "Failed",
inline: true, inline: true,
}, },
{ {
name: "`⚠️`Error Message", name: "`⚠️` Error Message",
value: `\`\`\`${errorMessage}\`\`\``, value: `\`\`\`${errorMessage}\`\`\``,
}, },
{ {
name: "`🧷`Build Link", name: "`🧷` Build Link",
value: `[Click here to access build link](${buildLink})`, value: `[Click here to access build link](${buildLink})`,
}, },
], ],

View File

@@ -26,7 +26,7 @@ export const sendBuildSuccessNotifications = async ({
adminId, adminId,
}: Props) => { }: Props) => {
const date = new Date(); const date = new Date();
const unixDate = ~~((Number(date)) / 1000); const unixDate = ~~(Number(date) / 1000);
const notificationList = await db.query.notifications.findMany({ const notificationList = await db.query.notifications.findMany({
where: and( where: and(
eq(notifications.appDeploy, true), eq(notifications.appDeploy, true),
@@ -58,41 +58,41 @@ export const sendBuildSuccessNotifications = async ({
if (discord) { if (discord) {
await sendDiscordNotification(discord, { await sendDiscordNotification(discord, {
title: "> `✅` - Build Success", title: "> `✅` Build Success",
color: 0x57f287, color: 0x57f287,
fields: [ fields: [
{ {
name: "`🛠️`Project", name: "`🛠️` Project",
value: projectName, value: projectName,
inline: true, inline: true,
}, },
{ {
name: "`⚙️`Application", name: "`⚙️` Application",
value: applicationName, value: applicationName,
inline: true, inline: true,
}, },
{ {
name: "`❔`Application Type", name: "`❔` Application Type",
value: applicationType, value: applicationType,
inline: true, inline: true,
}, },
{ {
name: "`📅`Date", name: "`📅` Date",
value: `<t:${unixDate}:D>`, value: `<t:${unixDate}:D>`,
inline: true, inline: true,
}, },
{ {
name: "`⌚`Time", name: "`⌚` Time",
value: `<t:${unixDate}:t>`, value: `<t:${unixDate}:t>`,
inline: true, inline: true,
}, },
{ {
name: "`❓`Type", name: "`❓` Type",
value: "Successful", value: "Successful",
inline: true, inline: true,
}, },
{ {
name: "`🧷`Build Link", name: "`🧷` Build Link",
value: `[Click here to access build link](${buildLink})`, value: `[Click here to access build link](${buildLink})`,
}, },
], ],

View File

@@ -26,7 +26,7 @@ export const sendDatabaseBackupNotifications = async ({
errorMessage?: string; errorMessage?: string;
}) => { }) => {
const date = new Date(); const date = new Date();
const unixDate = ~~((Number(date)) / 1000); const unixDate = ~~(Number(date) / 1000);
const notificationList = await db.query.notifications.findMany({ const notificationList = await db.query.notifications.findMany({
where: and( where: and(
eq(notifications.databaseBackup, true), eq(notifications.databaseBackup, true),
@@ -65,37 +65,37 @@ export const sendDatabaseBackupNotifications = async ({
await sendDiscordNotification(discord, { await sendDiscordNotification(discord, {
title: title:
type === "success" type === "success"
? "> `✅` - Database Backup Successful" ? "> `✅` Database Backup Successful"
: "> `❌` - Database Backup Failed", : "> `❌` Database Backup Failed",
color: type === "success" ? 0x57f287 : 0xed4245, color: type === "success" ? 0x57f287 : 0xed4245,
fields: [ fields: [
{ {
name: "`🛠️`Project", name: "`🛠️` Project",
value: projectName, value: projectName,
inline: true, inline: true,
}, },
{ {
name: "`⚙️`Application", name: "`⚙️` Application",
value: applicationName, value: applicationName,
inline: true, inline: true,
}, },
{ {
name: "`❔`Database", name: "`❔` Database",
value: databaseType, value: databaseType,
inline: true, inline: true,
}, },
{ {
name: "`📅`Date", name: "`📅` Date",
value: `<t:${unixDate}:D>`, value: `<t:${unixDate}:D>`,
inline: true, inline: true,
}, },
{ {
name: "`⌚`Time", name: "`⌚` Time",
value: `<t:${unixDate}:t>`, value: `<t:${unixDate}:t>`,
inline: true, inline: true,
}, },
{ {
name: "`❓`Type", name: "`❓` Type",
value: type value: type
.replace("error", "Failed") .replace("error", "Failed")
.replace("success", "Successful"), .replace("success", "Successful"),
@@ -104,7 +104,7 @@ export const sendDatabaseBackupNotifications = async ({
...(type === "error" && errorMessage ...(type === "error" && errorMessage
? [ ? [
{ {
name: "`⚠️`Error Message", name: "`⚠️` Error Message",
value: `\`\`\`${errorMessage}\`\`\``, value: `\`\`\`${errorMessage}\`\`\``,
}, },
] ]

View File

@@ -15,7 +15,7 @@ export const sendDockerCleanupNotifications = async (
message = "Docker cleanup for dokploy", message = "Docker cleanup for dokploy",
) => { ) => {
const date = new Date(); const date = new Date();
const unixDate = ~~((Number(date)) / 1000); const unixDate = ~~(Number(date) / 1000);
const notificationList = await db.query.notifications.findMany({ const notificationList = await db.query.notifications.findMany({
where: and( where: and(
eq(notifications.dockerCleanup, true), eq(notifications.dockerCleanup, true),
@@ -46,26 +46,26 @@ export const sendDockerCleanupNotifications = async (
if (discord) { if (discord) {
await sendDiscordNotification(discord, { await sendDiscordNotification(discord, {
title: "> `✅` - Docker Cleanup", title: "> `✅` Docker Cleanup",
color: 0x57f287, color: 0x57f287,
fields: [ fields: [
{ {
name: "`📅`Date", name: "`📅` Date",
value: `<t:${unixDate}:D>`, value: `<t:${unixDate}:D>`,
inline: true, inline: true,
}, },
{ {
name: "`⌚`Time", name: "`⌚` Time",
value: `<t:${unixDate}:t>`, value: `<t:${unixDate}:t>`,
inline: true, inline: true,
}, },
{ {
name: "`❓`Type", name: "`❓` Type",
value: "Successful", value: "Successful",
inline: true, inline: true,
}, },
{ {
name: "`📜`Message", name: "`📜` Message",
value: `\`\`\`${message}\`\`\``, value: `\`\`\`${message}\`\`\``,
}, },
], ],

View File

@@ -12,7 +12,7 @@ import {
export const sendDokployRestartNotifications = async () => { export const sendDokployRestartNotifications = async () => {
const date = new Date(); const date = new Date();
const unixDate = ~~((Number(date)) / 1000); const unixDate = ~~(Number(date) / 1000);
const notificationList = await db.query.notifications.findMany({ const notificationList = await db.query.notifications.findMany({
where: eq(notifications.dokployRestart, true), where: eq(notifications.dokployRestart, true),
with: { with: {
@@ -35,21 +35,21 @@ export const sendDokployRestartNotifications = async () => {
if (discord) { if (discord) {
await sendDiscordNotification(discord, { await sendDiscordNotification(discord, {
title: "> `✅` - Dokploy Server Restarted", title: "> `✅` Dokploy Server Restarted",
color: 0x57f287, color: 0x57f287,
fields: [ fields: [
{ {
name: "`📅`Date", name: "`📅` Date",
value: `<t:${unixDate}:D>`, value: `<t:${unixDate}:D>`,
inline: true, inline: true,
}, },
{ {
name: "`⌚`Time", name: "`⌚` Time",
value: `<t:${unixDate}:t>`, value: `<t:${unixDate}:t>`,
inline: true, inline: true,
}, },
{ {
name: "`❓`Type", name: "`❓` Type",
value: "Successful", value: "Successful",
inline: true, inline: true,
}, },