config
This commit is contained in:
parent
072c7e6efa
commit
bc519f4741
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
config.json
|
config.json
|
||||||
node_modules
|
node_modules
|
||||||
recordings
|
recordings
|
||||||
|
.idea
|
||||||
|
|
7
index.js
7
index.js
|
@ -4,6 +4,13 @@ const client = new Discord.Client();
|
||||||
const config = require('./config.json');
|
const config = require('./config.json');
|
||||||
const commands = require(`./bin/commands`);
|
const commands = require(`./bin/commands`);
|
||||||
|
|
||||||
|
//in case the bot was not configured properly
|
||||||
|
if(!config.PREFIX || !config.BOT_TOKEN) {
|
||||||
|
console.error("Error: the configuration file was configured properly.");
|
||||||
|
console.error("Make sure there are no spelling mistakes.");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
client.on('message', msg => {
|
client.on('message', msg => {
|
||||||
if (msg.content.startsWith(config.PREFIX)) {
|
if (msg.content.startsWith(config.PREFIX)) {
|
||||||
const commandBody = msg.content.substring(config.PREFIX.length).split(' ');
|
const commandBody = msg.content.substring(config.PREFIX.length).split(' ');
|
||||||
|
|
Loading…
Reference in a new issue