diff --git a/Dockerfile.api b/Dockerfile.api index 7c4cd04..6f7affe 100644 --- a/Dockerfile.api +++ b/Dockerfile.api @@ -42,11 +42,15 @@ RUN update-ms-fonts && fc-cache -f RUN adduser esmBot -s /bin/sh -D WORKDIR /home/esmBot/.internal +COPY ./assets/caption.otf /home/esmBot/.font/caption.otf +COPY ./assets/caption2.ttf /home/esmBot/.font/caption2.ttf +COPY ./assets/hbc.ttf /home/esmBot/.font/hbc.ttf +RUN fc-cache -f + COPY ./package.json package.json COPY ./package-lock.json package-lock.json RUN npm install COPY . . -RUN npm run build USER esmBot EXPOSE 3000 diff --git a/Dockerfile.bot b/Dockerfile.bot index e365881..4718a99 100644 --- a/Dockerfile.bot +++ b/Dockerfile.bot @@ -41,11 +41,16 @@ RUN update-ms-fonts && fc-cache -f RUN adduser esmBot -s /bin/sh -D WORKDIR /home/esmBot/.internal + +COPY ./assets/caption.otf /home/esmBot/.font/caption.otf +COPY ./assets/caption2.ttf /home/esmBot/.font/caption2.ttf +COPY ./assets/hbc.ttf /home/esmBot/.font/hbc.ttf +RUN fc-cache -f + COPY ./package.json package.json COPY ./package-lock.json package-lock.json RUN npm install COPY . . -RUN npm run build USER esmBot ENTRYPOINT ["node", "app.js"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 783ba90..043baee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: restart: unless-stopped volumes: - ./logs:/home/esmBot/.internal/logs - - bot-output:/home/esmBot/output + - bot-help:/home/esmBot/help - bot-temp:/home/esmBot/temp env_file: - .env @@ -88,7 +88,7 @@ services: ipv4_address: 172.20.0.7 volumes: - bot-output: + bot-help: bot-temp: mongo-data: @@ -97,5 +97,4 @@ networks: driver: bridge ipam: config: - - subnet: 172.20.0.0/24 - gateway: 172.20.0.1 \ No newline at end of file + - subnet: 172.20.0.0/24 \ No newline at end of file diff --git a/utils/soundplayer.js b/utils/soundplayer.js index 519be6b..6db9c45 100644 --- a/utils/soundplayer.js +++ b/utils/soundplayer.js @@ -6,7 +6,7 @@ const moment = require("moment"); require("moment-duration-format"); const { Manager } = require("@lavacord/eris"); -const nodes = require("../servers.json").lava; +let nodes = require("../servers.json").lava; exports.players = new Map(); @@ -20,17 +20,17 @@ exports.status = false; exports.connected = false; exports.checkStatus = async () => { - const statuses = []; + const newNodes = []; for (const node of nodes) { try { const response = await fetch(`http://${node.host}:${node.port}/version`, { headers: { Authorization: node.password } }).then(res => res.text()); - if (response) statuses.push(false); + if (response) newNodes.push(node); } catch { - statuses.push(true); + logger.log(`Failed to get status of Lavalink node ${node.host}.`); } } - const result = statuses.filter(Boolean); - this.status = result.length > 0 ? true : false; + nodes = newNodes; + this.status = newNodes.length === 0 ? true : false; return this.status; };