Skip to content

Commit

Permalink
Dockerfile, fix env for PRUNING (include/play.js) (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
Encryptize committed Nov 14, 2020
1 parent d498514 commit c88760e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
@@ -0,0 +1,24 @@
FROM node:12.19-slim

ENV USER=evobot

# install python and make
RUN apt-get update && \
apt-get install -y python3 build-essential && \
apt-get purge -y --auto-remove

# create evobot user
RUN groupadd -r ${USER} && \
useradd --create-home --home /home/evobot -r -g ${USER} ${USER}

# set up volume and user
USER ${USER}
WORKDIR /home/evobot

COPY package*.json ./
RUN npm install
VOLUME [ "/home/evobot" ]

COPY . .

ENTRYPOINT [ "node", "index.js" ]
4 changes: 2 additions & 2 deletions include/play.js
Expand Up @@ -12,7 +12,7 @@ module.exports = {
config = null;
}

const PRUNING = config.PRUNING ? config.PRUNING : process.env.PRUNING;
const PRUNING = config ? config.PRUNING : process.env.PRUNING
const SOUNDCLOUD_CLIENT_ID = config ? config.SOUNDCLOUD_CLIENT_ID : process.env.SOUNDCLOUD_CLIENT_ID;

const queue = message.client.queue.get(message.guild.id);
Expand Down Expand Up @@ -184,7 +184,7 @@ module.exports = {

collector.on("end", () => {
playingMessage.reactions.removeAll().catch(console.error);
if (PRUNING && playingMessage && !playingMessage.deleted) {
if (PRUNING === true || (PRUNING == "true") && playingMessage && !playingMessage.deleted) {
playingMessage.delete({ timeout: 3000 }).catch(console.error);
}
});
Expand Down

0 comments on commit c88760e

Please sign in to comment.