This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathindex.js
44 lines (33 loc) · 1.56 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const { Client } = require("klasa");
const { Collection } = require("discord.js");
const config = require("./assets/settings.json");
const { envCheck, speech, dataManager, util, commandRemover, schemaManager } = require("./utilities/utilExport.js");
const { existsSync } = require("fs");
envCheck(); //Checks to make sure Margarine is running in the right enviroment.
const client = new Client({
fetchAllMembers: false,
prefix: config.prefix,
language: "en-CA",
commandEditing: true,
readyMessage: (client) =>
`This is ${client.user.username} speaking! Online and awaiting orders!\nI'm currently serving ${client.guilds.cache.size} guilds and ${client.users.cache.size} people!`
});
Client.defaultPermissionLevels
.add(5, ({ guild, member }) => guild && member.roles.cache.has(guild.settings.modRole))
.add(6, ({ guild, member }) => guild && member.permissions.has("ADMINISTRATOR"))
.add(7, ({ guild, member }) => guild && guild.ownerID === member.id)
.add(9, ({ author, client }) => author === client.owner || client.secondary.includes(author.id))
.add(10, ({ author, client }) => author === client.owner);
schemaManager(client); //Adds all configurable settings.
client.speech = speech;
client.dataManager = dataManager;
client.util = util; //All utility functions and extra search functions
if (!existsSync(config.database)) {
dataManager("init");
} //Init the SQLite Database
client.music = new Collection();
client.build = config.build;
client.globalPrefix = config.prefix;
client.itemData = require("./assets/items.json");
commandRemover();
client.login(config.token);