Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
lxRbckl committed Mar 1, 2024
1 parent 45b22e6 commit 9e40c02
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 54 deletions.
17 changes: 10 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM node:18.16.0


ENV maxMembers 15
ENV guildId '<insert>'
ENV channelId '<insert>'
ENV dataFilePath '/data/'
ENV discordToken undefined
ENV applicationId '<insert>'
# referencing docker compose #
ENV discordToken ${discordToken}

ENV guildId ${guildId}
ENV channelId ${channelId}
ENV applicationId ${applicationId}

ENV maxMembers ${maxMembers}
ENV dataFilePath ${dataFilePath}


WORKDIR /app
Expand All @@ -17,4 +20,4 @@ RUN npm install
RUN mkdir /app/data


CMD ["node", "index.js"]
CMD ["node", "index.js"]
25 changes: 1 addition & 24 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,8 @@ const client = require('./source/client.js');
// >


// setup <
const guildId = process.env.guildId;
const token = process.env.discordToken;
const channelId = process.env.channelId;
const maxMembers = process.env.maxMembers;
const dataFilePath = process.env.dataFilePath;
const applicationId = process.env.applicationId;

// >


(async () => {

new client({

pToken : token,
pGuildId : guildId,
pChannelId : channelId,
pMaxMembers : maxMembers,
pDataFilePath : dataFilePath,
pApplicationId : applicationId

}).run();

})();
(async () => {new client(token).run();})();


// export <
Expand Down
23 changes: 5 additions & 18 deletions source/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,14 @@ const encrypt = require('./command/encrypt.js');

class client {

constructor({

pToken,
pGuildId,
pChannelId,
pMaxMembers,
pDataFilePath,
pApplicationId

}) {
constructor(pToken) {

// setup <
// initialize <
this.token = pToken;
this.guildId = pGuildId;
this.channelId = pChannelId;
this.maxMembers = pMaxMembers;
this.dataFilePath = pDataFilePath;
this.applicationId = pApplicationId;
this.guildId = process.env.guildId;
this.channelId = process.env.channelId;
this.applicationId = process.env.applicationId;

this.client = new Client({

Expand All @@ -57,9 +46,7 @@ class client {
this.database = new database({

pClient : this.client,
pChannelId : this.channelId,
pMaxMembers : this.maxMembers,
pDataFilePath : this.dataFilePath
pChannelId : this.channelId

});

Expand Down
8 changes: 3 additions & 5 deletions source/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ class database extends local {
constructor({

pClient,
pChannelId,
pMaxMembers,
pDataFilePath
pChannelId

}) {

super();
this.show = false;
this.client = pClient;
this.channelId = pChannelId;
this.maxMembers = pMaxMembers;
this.referencePath = pDataFilePath;
this.maxMembers = process.env.maxMembers;
this.referencePath = process.env.dataFilePath;

}

Expand Down

0 comments on commit 9e40c02

Please sign in to comment.