-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.js
94 lines (91 loc) · 3.54 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//======== Packages ========
require('dotenv').config()
const {
Client,
Collection,
IntentsBitField,
Partials
} = require('discord.js');
const {
QuickDB,
JSONDriver
} = require(`quick.db`);
const config = require(`${process.cwd()}/storage/config.js`);
const clc = require("cli-color");
const fs = require('fs');
const db = new QuickDB({
driver: new JSONDriver()
});
const client = new Client({
restRequestTimeout: 15000,
intents: new IntentsBitField(32767),
partials: [
Partials.Message,
Partials.Channel,
Partials.User,
Partials.GuildMember
],
shards: 'auto',
allowedMentions: {
parse: ["roles", "users", "everyone"],//mentions disable
repliedUser: false,//disable mention in replying messages
},
ws:{
properties: {
browser: "Discord Android",//Discord Web | Discord Android | Discord Ios | Discord Client
os: "Android"//Other | Android | iOS | TempleOS | Linux | Mac OS X | Windows
},
},
});
client.db = db;
client.config = config;
client.prefix = client.config.discord.prefix;
client.token = client.config.discord.token;
client.emotes = require(`${process.cwd()}/storage/emotes.json`);
client.colors = require(`${process.cwd()}/storage/colors.json`);
client.embed = require(`${process.cwd()}/storage/embed.json`);
client.categories = fs.readdirSync(`${process.cwd()}/commands`);
client.commands = new Collection();
client.cooldowns = new Collection();
//======== Loading Starts =========
let starts = fs.readdirSync(`${process.cwd()}/start`).filter(file => file.endsWith('.js'));
let counter = 0;
let stringlength = 69;
starts.forEach((file) => {
require(`${process.cwd()}/start/${file}`)(client);
counter += 1;
});
try {
console.log("\n")
console.log(clc.yellowBright(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`))
console.log(clc.yellowBright(` ┃ `) + " ".repeat(-1 + stringlength - ` ┃ `.length) + clc.yellowBright("┃"))
console.log(clc.yellowBright(` ┃ `) + clc.greenBright(` ${clc.magentaBright(counter)} Starts Is Loaded!!`) + " ".repeat(-1 + stringlength - ` ┃ `.length - ` ${counter} Starts Is Loaded!!`.length) + clc.yellowBright("┃"))
console.log(clc.yellowBright(` ┃ `) + " ".repeat(-1 + stringlength - ` ┃ `.length) + clc.yellowBright("┃"))
console.log(clc.yellowBright(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`))
console.log("\n")
} catch { /* */ }
//======== Consol ========
if(client.token){
client.login(client.token).catch(e => {
console.log(clc.red("The Bot Token You Entered Into Your Project Is Incorrect Or Your Bot's INTENTS Are OFF!\n" + e))
})
} else {
console.log(clc.red("Please Write Your Bot Token Opposite The Token In The config.js File In Your Project!"))
}
//========== Replit Alive
setInterval(() => {
if(!client || !client.user) {
client.logger("The Client Didn't Login Proccesing Kill 1")
process.kill(1);
} else {
}
}, 10000);
/**
* @Info
* Bot Coded by Mr.SIN RE#1528 :) | https://dsc.gg/persian-caesar
* @Info
* Work for Persian Caesar | https://dsc.gg/persian-caesar
* @Info
* Please Mention Us "Persian Caesar", When Have Problem With Using This Code!
* @Info
*/