Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Cleaned file from empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasFeld22 committed Sep 14, 2017
1 parent 0c636f3 commit fd2cee0
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint no-console: 0 */
const Discord = require("discord.js");

const client = new Discord.Client();
const setup = require("./setup.js");
var util = require("./src/util.js")
Expand Down Expand Up @@ -30,7 +29,6 @@ module.exports.start = function(config) {
} else if (i.type == "commands") {
client.functions.types.commands.push(i.name);
}

})
client.config = config;
start(client, client.config, client.commanddata)
Expand All @@ -39,17 +37,8 @@ module.exports.start = function(config) {
return console.error("An error occurred while loading commands.", err)
}
console.log(err, err.stack)

})




}




function start(client, config, commanddata) {
var startedAt = new Date();
client.login(config.token)
Expand All @@ -74,7 +63,6 @@ function start(client, config, commanddata) {
} else {
client.config.owner_id = application.owner.id
}

}).catch((err) => {
if (client.developer) {
console.warn("Can't fetch application, error: \n", err)
Expand All @@ -84,15 +72,11 @@ function start(client, config, commanddata) {
return console.error("The bot can't find the owner_id set up inside your file, \nThis could be because it's not valid, or because you are not in a server with it, please invite it to a server where you are on.")
}
})


client.functions.boot.bootfuncs.forEach((data) => {

function returnfunction() {
return data.function(client)
}


setTimeout(function() {
if (data.time > 0) {
setInterval(returnfunction, data.time)
Expand All @@ -101,24 +85,10 @@ function start(client, config, commanddata) {

}, data.delay);
})



console.log(commanddata.commands.size + " commands | " + commanddata.aliases.size + " aliases, bot online")
console.log("To add new commands, type \"" + config.prefix + "createcommand <name> <alias1> <alias2> <alias3>\" to generate a new template!")




})



client.on("message", (message) => {




// commands
if (!message.content.startsWith(config.prefix)) {
dofuncs(client, message, "message").catch((data) => {
Expand Down Expand Up @@ -155,8 +125,6 @@ function start(client, config, commanddata) {
}
})
}


function doCommand(command, client, message) {
command = client.commanddata.commands.get(command);
if (command === undefined) {
Expand All @@ -173,13 +141,11 @@ function doCommand(command, client, message) {
if (message.author.id == client.config.owner_id) {
message.channel.send("[EDB] Command: **" + command.name + "** | Requires the " + mod + " package to be installed.\nTo install this package, close the script and type: `npm install " + mod.slice(1, -1) + "`")
}

} else {
console.warn("Command: " + command.name + " | had an error. Show the developer of the command module that you are getting this error code: \n" + err)
}
}
}

function dofuncs(client, message, type) {
return new Promise(function(resolve, reject) {
var funcnumber = 0;
Expand All @@ -188,7 +154,6 @@ function dofuncs(client, message, type) {
if (client.functions.types.messages.length == 0) {
return resolve()
}

client.functions.messages.messagefuncs.forEach(i => {
var num = client.functions.messages.messagefuncs.size
if (client.functions.types.messages.includes(i.name) == false) {
Expand Down Expand Up @@ -254,17 +219,12 @@ function dofuncs(client, message, type) {
done(number, num)
}
})


}


function done(xnumber, num) {
number = xnumber + 1
if (number == num) {
return resolve()
}
}

});
}

0 comments on commit fd2cee0

Please sign in to comment.