Skip to content

Commit

Permalink
improves
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Aug 23, 2023
1 parent c8e0b5a commit d468108
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions helpers/checkConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const colors = require("colors");
const {BUTTONS} = require("../config");
module.exports = () => {
if(BUTTONS.length > 2) {
console.warn("ERROR: ".red + "You can't load more than 2 buttons!");
process.exit(0);
}
}
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const { Client } = require('discord-rpc');
const { DETAILS, STATE, LARGE_IMAGE, LARGE_TEXT, SMALL_IMAGE, SMALL_TEXT, BUTTONS } = require('./config');
const checkConfig = require('./helpers/checkConfig');
require("dotenv").config();

checkConfig();
const client = new Client({
transport: 'ipc'
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"homepage": "https://github.com/rhaym-tech/DJS-RichPresence#readme",
"dependencies": {
"colors": "^1.4.0",
"discord-rpc": "^4.0.1",
"dotenv": "^16.0.3"
}
Expand Down

0 comments on commit d468108

Please sign in to comment.