mirror of
https://github.com/SrIzan10/vinci.git
synced 2026-06-06 01:07:00 +00:00
feat: uptime on stats command
This commit is contained in:
@@ -19,6 +19,7 @@ export default commandModule({
|
||||
const ramtotal = await axios(`http://192.168.1.44:7271/ramtotal`)
|
||||
const ramfree = await axios(`http://192.168.1.44:7271/ramfree`)
|
||||
const dockertotal = await axios(`http://192.168.1.44:7271/dockertotal`)
|
||||
const nodeuptime = await axios(`http://192.168.1.44:7271/uptime`)
|
||||
const uptime = prettySeconds(process.uptime())
|
||||
const embed = new EmbedBuilder()
|
||||
.setAuthor({name: `${ctx.user.username}`, iconURL: `${ctx.user.displayAvatarURL()}`})
|
||||
@@ -33,7 +34,9 @@ export default commandModule({
|
||||
{name: '\u200B', value: '\u200B', inline: true},
|
||||
{name: 'Contenedores de Docker', value: `${dockertotal.data}`, inline: true},
|
||||
{name: '\u200B', value: '\u200B', inline: true},
|
||||
{name: 'Tiempo encendido', value: `${uptime}`},
|
||||
{name: 'Tiempo encendido', value: `${uptime}`, inline: true},
|
||||
{name: '\u200B', value: '\u200B', inline: true},
|
||||
{name: 'Uptime del servidor', value: `${prettySeconds(`${nodeuptime.data}`)}`}
|
||||
)
|
||||
await ctx.interaction.editReply({embeds: [embed]})
|
||||
},
|
||||
|
||||
6
stats.js
6
stats.js
@@ -3,6 +3,7 @@ const port = 8080
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const si = require('systeminformation');
|
||||
const os = require('os');
|
||||
function formatBytes(bytes, decimals = 2) {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
|
||||
@@ -48,5 +49,10 @@ app.get("/dockertotal", async function (req, res) {
|
||||
res.send(`${docker.containers}`)
|
||||
})
|
||||
|
||||
app.get("/uptime", async function (req, res) {
|
||||
const uptime = os.uptime()
|
||||
res.send(`${uptime}`)
|
||||
})
|
||||
|
||||
// start the server listening for requests
|
||||
app.listen(port, () => {console.log("The webserver is listening on port " + port)});
|
||||
@@ -1,12 +0,0 @@
|
||||
const mongoose = require("mongoose")
|
||||
|
||||
const twitchModel = new mongoose.Schema({
|
||||
title: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const twitch = mongoose.model("SrIzan10-twitch-schema", twitchModel)
|
||||
|
||||
module.exports = twitch;
|
||||
Reference in New Issue
Block a user