Update crew.js

This commit is contained in:
Lucas Gabriel 2024-09-08 00:18:42 -03:00 committed by GitHub
parent c3ac5c8e7c
commit 1b55e1b69a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,18 @@ const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js');
const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch);
const os = require('os'); const os = require('os');
function getGitCommitHash() {
return new Promise((resolve, reject) => {
exec('git rev-parse --short HEAD', (error, stdout, stderr) => {
if (error) {
reject(`Error: ${stderr}`);
} else {
resolve(stdout.trim());
}
});
});
}
function formatUptime(uptime) { function formatUptime(uptime) {
const hours = Math.floor(uptime / 3600); const hours = Math.floor(uptime / 3600);
const minutes = Math.floor((uptime % 3600) / 60); const minutes = Math.floor((uptime % 3600) / 60);