Repository navigation
Expand file tree
/
Copy pathindex.js
More file actions
59 lines (47 loc) · 1.85 KB
/
Copy pathindex.js
File metadata and controls
59 lines (47 loc) · 1.85 KB
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
const Discord = require("discord.js");
const client = new Discord.Client({ partials: ['MESSAGE', 'CHANNEL', 'REACTION'], restTimeOffset: 50, messageCacheMaxSize: 50 });
const fs = require("fs");
const database = require('quick.db');
const moment = require('moment');
moment.locale('tr');
client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
fs.readdir("./commands/", (err, files) => {
if(err) console.error(err);
console.log(`${files.filter(a => a.endsWith('.js')).length} komut yüklenecek.`);
files.filter(a => a.endsWith('.js')).forEach(async f => {
let command = require(`./commands/${f}`);
if(!command) return;
client.commands.set(command.help.name, command);
command.conf.aliases.forEach(alias => client.aliases.set(alias, command.help.name));
console.log(`${command.help.name} yüklendi.`);
});
});
client.elevation = message => {
if(!message.guild) return;
var permlvl = 0;
if(message.member.permissions.has("MANAGE_MESSAGES")) permlvl = 1;
if(message.member.permissions.has("BAN_MEMBERS")) permlvl = 2;
if(message.member.permissions.has("ADMINISTRATOR")) permlvl = 3;
return permlvl;
};
client.config = require('./structures/config.js');
/* TOKEN VE PREFİX ŞEYLERİNİ CONFİG.JS'DEN AYARLAYACAKSINIZ */
client.login(client.config.token);
client.on('ready', async () => {
require("./util/eventLoader")(client);
client.user.setStatus('online');
client.user.setActivity('-help | -yardım | discord.gg/codare', { type: 'WATCHING' })
client.users.cache.forEach(x => {
if(database.fetch(`k.${x.id}`)) {
setTimeout(() => {
database.delete(`k.${x.id}`)
database.delete(`ik.${x.id}`);
}, database.fetch(`k.${x.id}`)-Date.now());
};
});
return console.log(`${client.user.tag} ismi ile giriş yaptım.`);
});
/*
Herhangi bir sorunda discord.gg/codare yada can#0002
*/