mirror of
https://github.com/thedrewen/protojx-manager.git
synced 2026-03-21 01:48:54 +01:00
fix(status): integrate dayjs for formatted timestamps in notifications
This commit is contained in:
7
package-lock.json
generated
7
package-lock.json
generated
@@ -11,6 +11,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/ping": "^0.4.4",
|
"@types/ping": "^0.4.4",
|
||||||
"cron": "^4.3.3",
|
"cron": "^4.3.3",
|
||||||
|
"dayjs": "^1.11.19",
|
||||||
"discord.js": "^14.24.2",
|
"discord.js": "^14.24.2",
|
||||||
"dotenv": "^17.2.2",
|
"dotenv": "^17.2.2",
|
||||||
"pg": "^8.16.3",
|
"pg": "^8.16.3",
|
||||||
@@ -552,9 +553,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/dayjs": {
|
"node_modules/dayjs": {
|
||||||
"version": "1.11.18",
|
"version": "1.11.19",
|
||||||
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.18.tgz",
|
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",
|
||||||
"integrity": "sha512-zFBQ7WFRvVRhKcWoUh+ZA1g2HVgUbsZm9sbddh8EC5iv93sui8DVVz1Npvz+r6meo9VKfa8NyLWBsQK1VvIKPA==",
|
"integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/debug": {
|
"node_modules/debug": {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/ping": "^0.4.4",
|
"@types/ping": "^0.4.4",
|
||||||
"cron": "^4.3.3",
|
"cron": "^4.3.3",
|
||||||
|
"dayjs": "^1.11.19",
|
||||||
"discord.js": "^14.24.2",
|
"discord.js": "^14.24.2",
|
||||||
"dotenv": "^17.2.2",
|
"dotenv": "^17.2.2",
|
||||||
"pg": "^8.16.3",
|
"pg": "^8.16.3",
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { HostsLog } from "../entity/hostslog.entity";
|
|||||||
import { Repository } from "typeorm";
|
import { Repository } from "typeorm";
|
||||||
import { Follow } from "../entity/follow.entity";
|
import { Follow } from "../entity/follow.entity";
|
||||||
import { Guild } from "../entity/guild.entity";
|
import { Guild } from "../entity/guild.entity";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
type Nofity = {time: Date, name : string, alive : boolean, type : InfraType, host: string};
|
type Nofity = {time: Date, name : string, alive : boolean, type : InfraType, host: string};
|
||||||
|
|
||||||
@@ -302,9 +303,8 @@ export class StatusService {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
const now = new Date();
|
container.addTextDisplayComponents((text) => text.setContent(`${live ? 'Last update : ' : ''}<t:${dayjs().unix()}:D> - Receive automatic notifications when there is an outage with /follow !`));
|
||||||
container.addTextDisplayComponents((text) => text.setContent(`${live ? 'Last update : ' : ''}${now.getDate()}-${now.getMonth() + 1}-${now.getFullYear()} ${(now.getHours() + '').padStart(2, "0")}:${(now.getMinutes() + '').padStart(2, "0")} - Receive automatic notifications when there is an outage with /follow !`));
|
|
||||||
|
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user