Add configuration for uptime-kuma monitoring

This commit is contained in:
Christopher Cookman 2024-05-12 02:03:28 -06:00
parent 325bd25f07
commit e70cdd972c
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42
2 changed files with 21 additions and 7 deletions

View file

@ -25,5 +25,11 @@
"enabled": false,
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD"
},
,
"uptime-kuma": {
"enabled": false,
"url": "",
"interval": 60
}
}

View file

@ -432,6 +432,14 @@ xmpp.on("stanza", (stanza) => {
xmpp.on("online", async (address) => {
if (config["uptime-kuma"].enabled) {
setInterval(() => {
// Send POST request to config["uptime-kuma"].url
fetch(config["uptime-kuma"].url, {
method: 'POST'
})
}, config["uptime-kuma"].interval * 1000) // Every X seconds
}
errCount = 0;
// Start listening on all channels, (dont ban me funny man)
@ -1008,13 +1016,13 @@ discord.on("interactionCreate", async (interaction) => {
case "volume": // Set volume
channel = interaction.member.voice.channel;
if (!channel) return interaction.reply({ content: "You need to be in a voice channel", ephemeral: true });
volume = interaction.options.getInteger("volume")/100;
volume = interaction.options.getInteger("volume") / 100;
// Make sure volume isnt negative
if (volume < 0) volume = 0;
if (volume > 1) volume = 1;
res = setVolume(channel, volume)
if (res) {
interaction.reply({ content: `Set volume to ${volume*100}%` });
interaction.reply({ content: `Set volume to ${volume * 100}%` });
} else {
interaction.reply({ content: "Failed to set volume", ephemeral: true });
}