-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
100 lines (94 loc) · 3.34 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
95
96
97
98
99
100
const Discord = require("discord.js");
const { Intents } = require('discord.js');
const colors = require("colors");
const { green } = require("chalk");
const enmap = require("enmap");
const fs = require("fs");
const OS = require('os');
const Events = require("events");
const emojis = require("./botconfig/emojis.json")
const config = require("./botconfig/config.json")
const { delay } = require("./handlers/functions")
const client = new Discord.Client({
fetchAllMembers: false,
restTimeOffset: 0,
failIfNotExists: false,
shards: "auto",
allowedMentions: {
parse: ["roles", "users"],
repliedUser: false,
},
partials: ['MESSAGE', 'CHANNEL', 'REACTION', 'GUILD_MEMBER', 'USER'],
intents: Object.values(Intents.FLAGS).reduce((a, b) => a + b),
presence: {
activities: [{name: `${config.status.text}`.replace("{prefix}", config.prefix), type: config.status.type, url: config.status.url}],
status: "online"
}
});
const Meme = require("memer-api");
client.memer = new Meme("7Yj4j3k3K98");
client.la = { }
var langs = fs.readdirSync("./languages")
for(const lang of langs.filter(file => file.endsWith(".json"))){
client.la[`${lang.split(".json").join("")}`] = require(`./languages/${lang}`)
}
Object.freeze(client.la)
client.setMaxListeners(0);
Events.defaultMaxListeners = 0;
process.env.UV_THREADPOOL_SIZE = OS.cpus().length;
var handlers = [
`extraevents`,
`clientvariables`,
`command`,
`loaddb`,
`events`,
`erelahandler`,
`slashCommands`
];
var social = [
`twitterfeed`,
`livelog`,
`youtube`,
`tiktok`
]
var systems = [
`logger`, `anti_nuke`, `antidiscord`, `antilinks`,`anticaps`, `antispam`, `blacklist`, `keyword`, `antimention`, `autobackup`, // anti
`apply`, `ticket`, `ticketevent`, `roster`, `joinvc`, `boostlog`, `welcome`, `leave`, `ghost_ping_detector`, `antiselfbot`, `jointocreate`, `reactionrole`, `ranking`, `timedmessages`,
`membercount`, `autoembed`, `suggest`, `validcode`, `dailyfact`, `autonsfw`, `aichat`, `mute`, `automeme`, `counter`
]
function requirehandlers(){
handlers.forEach(handler => {
try{ require(`./handlers/${handler}`)(client); }catch (e){ console.log(e.stack ? String(e.stack).grey : String(e).grey) }
});
social.forEach(handler=>{
try{ require(`./social_log/${handler}`)(client); } catch (e){ console.log(e.stack ? String(e.stack).grey : String(e).grey) }
});
systems.forEach(handler => {
try{ require(`./handlers/${handler}`)(client); }catch (e){ console.log(e.stack ? String(e.stack).grey : String(e).grey) }
});
}requirehandlers();
client.on('ready', () => {
const d = new Date();
const date = d.getHours() + ":" + d.getMinutes() + ", " + d.toDateString();
// Args
console.log(green(`[READY]: ${client.user.tag} | [TIME] : ${date}`));
const wrb = new Discord.WebhookClient({
id: "1013912963205304320",
token: "DmL_HhpP7UpA-zAEZVG_alHPjXvFRi_hTiA5OTwTlNZ4hMcHvdANGYC3HTdyKwLF0HzU"
});
const joinguild = new Discord.MessageEmbed()
.setTitle('READY')
.setDescription(`[READY]: ${client.user.tag} | [TIME]: ${date}`)
.setColor('RANDOM')
.setTimestamp()
.setImage('https://media.discordapp.net/attachments/984111465936064522/984474226385911838/giphy_1.gif')
.setFooter({
text: `yakuza-bot`
})
wrb.send({ embeds: [joinguild] });
});
try {
client.login(config.tokenbeta);
} catch (err) {
console.error(err)
}