Skip to content

Commit

Permalink
Added my devtools-ts to reduce code in the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Dec 8, 2021
1 parent b5b43b1 commit 2f297ec
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { Client, Collection, Intents } = require("discord.js");
const { logger } = require("./modules/logger.js");
const { token, mongourl } = require("./config.json");
const { Database } = require("quickmongo");
const { connectDatabase } = require("./modules/DatabaseConnection");
const { commandsHelper } = require("./modules/commandsHelper");
const { Utils, APIs, StringUtils } = require("devtools-ts");
const Utilities = new Utils();

if (!token || !mongourl)
return logger(
Expand All @@ -27,15 +27,17 @@ const { Player } = require("discord-player");
const player = new Player(client);
client.player = player;
client.commands = new Collection();
client.logger = logger;
client.logger = Utilities.logger;
client.db = new Database(mongourl);
client.apis = new APIs();
client.tools = new StringUtils();

// Register everything...
commandsHelper.registerAllCommands(__dirname + "/commands", client);
commandsHelper.registerAllEvents(__dirname + "/events", client);
playerEvents(client.player);

// Connect to DATABASE
connectDatabase(mongourl, client);
Utilities.connectToDataBase(mongourl, client);
// ... and go!
client.login(token);

0 comments on commit 2f297ec

Please sign in to comment.