docker
Some checks failed
Build and Publish Docker Images / build-and-push (push) Failing after 6m30s
Test Docker Compose Setup / test-compose (push) Failing after 30s
Test Docker Compose Setup / lint-dockerfiles (push) Failing after 34s
Test Docker Compose Setup / validate-compose (push) Failing after 12s
Build and Publish Docker Images / security-scan (push) Has been skipped
Build and Publish Docker Images / notify (push) Failing after 7s
Some checks failed
Build and Publish Docker Images / build-and-push (push) Failing after 6m30s
Test Docker Compose Setup / test-compose (push) Failing after 30s
Test Docker Compose Setup / lint-dockerfiles (push) Failing after 34s
Test Docker Compose Setup / validate-compose (push) Failing after 12s
Build and Publish Docker Images / security-scan (push) Has been skipped
Build and Publish Docker Images / notify (push) Failing after 7s
This commit is contained in:
15
Bot/index.js
15
Bot/index.js
@@ -1,6 +1,15 @@
|
||||
const { Client, GatewayIntentBits, EmbedBuilder } = require('discord.js');
|
||||
const axios = require('axios');
|
||||
const config = require('./config.json');
|
||||
// Load configuration from environment variables or config.json
|
||||
const config = {
|
||||
token: process.env.DISCORD_TOKEN || require('./config.json').token,
|
||||
guildID: process.env.GUILD_ID || require('./config.json').guildID,
|
||||
channelID: process.env.CHANNEL_ID || require('./config.json').channelID,
|
||||
clientID: process.env.CLIENT_ID || require('./config.json').clientID,
|
||||
updatetime: parseInt(process.env.UPDATE_TIME) || require('./config.json').updatetime,
|
||||
backendUrl: process.env.BACKEND_URL || '<YOUR_BACKEND_URL>',
|
||||
uptimeKumaUrl: process.env.UPTIME_KUMA_URL || '<YOUR_UPTIMEKUMA_URL>'
|
||||
};
|
||||
|
||||
const client = new Client({
|
||||
intents: [
|
||||
@@ -45,7 +54,7 @@ async function updateMessages() {
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await axios.get('<YOUR_BACKEND_URL>');
|
||||
const response = await axios.get(config.backendUrl);
|
||||
const monitors = response.data;
|
||||
|
||||
const gamingMonitors = monitors.filter(monitor => [
|
||||
@@ -96,7 +105,7 @@ async function sendMonitorsMessage(channel, category, monitors) {
|
||||
.setColor('#0099ff')
|
||||
.setDescription(description)
|
||||
.setFooter({ text: `Last updated: ${new Date().toLocaleString()}` })
|
||||
.setURL('<YOUR_UPTIMEKUMA_URL>');
|
||||
.setURL(config.uptimeKumaUrl);
|
||||
|
||||
try {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user