-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathchimp.js
488 lines (406 loc) · 17.3 KB
/
chimp.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
const Discord = require("discord.js");
const client = new Discord.Client();
const { Client, Util } = require("discord.js");
const fs = require("fs");
require("./util/eventLoader")(client);
client.ayarlar = {
"token": "NzY3MjQ2ODc1MzkyMjEzMDQy.X4vIVQ.3SMfRzgU8H8xqyhFLcypeim6GiU", // token
"prefix": "!", // prefix
"sahip": "",// sahip
}
/*
Bu altyapı can ♡ b#1010(Gökhan Can Bulut) tarafından discord.gg/codare için yapılmıştır.
Bot MIT license(lisansı silmek yasa dışıdır)'i ile paylaşılmıştır. Herhangi bir izinsiz paylaşma durumunda haklarımız devreye girmektedir.
İstediğiniz gibi kullanabilirsiniz. Herhangi bir komut yaptırmak isteyen kullanıcılar http://chimp.wtf sitesini ziyaret edebilir.
Altyapı "CloudUP" isimli Discord botundan örnek alınarak yapılmıştır.
MIT License
Copyright (c) 2020 chimp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
fs.readdir("./commands/", (err, files) => {
if (err) console.error(err);
const data = require('quick.db');
console.log('')
console.log(`${files.length} kadar komut yüklenecek.`)
files.forEach(async f => {
let props = require(`./commands/${f}`);
console.log(`Yüklendi: ${props.help.name}`);
client.commands.set(props.help.name, props);
props.conf.aliases.forEach(alias => {
client.aliases.set(alias, props.help.name);
});
});
console.log('')
});
client.reload = command => {
return new Promise((resolve, reject) => {
try {
delete require.cache[require.resolve(`./commands/${command}`)];
let cmd = require(`./commands/${command}`);
client.commands.delete(command);
client.aliases.forEach((cmd, alias) => {
if (cmd === command) client.aliases.delete(alias);
});
client.commands.set(command, cmd);
cmd.conf.aliases.forEach(alias => {
client.aliases.set(alias, cmd.help.name);
});
resolve();
} catch (e) {
reject(e);
}
});
};
client.load = command => {
return new Promise((resolve, reject) => {
try {
let cmd = require(`./commands/${command}`);
client.commands.set(command, cmd);
cmd.conf.aliases.forEach(alias => {
client.aliases.set(alias, cmd.help.name);
});
resolve();
} catch (e) {
reject(e);
}
});
};
client.unload = command => {
return new Promise((resolve, reject) => {
try {
delete require.cache[require.resolve(`./commands/${command}`)];
let cmd = require(`./commands/${command}`);
client.commands.delete(command);
client.aliases.forEach((cmd, alias) => {
if (cmd === command) client.aliases.delete(alias);
});
resolve();
} catch (e) {
reject(e);
}
});
};
client.elevation = message => {
if (!message.guild) {
return;
}
let 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 = 2;
if (message.author.id === message.guild.owner.id) permlvl = 4;
return permlvl;
};
var regToken = /[\w\d]{24}\.[\w\d]{6}\.[\w\d-_]{27}/g
client.login(client.ayarlar.token);
const moment = require('moment');
moment.locale('tr');
const { S_IFREG } = require("constants");
const data = require('quick.db');
const logs = require('discord-logs');
logs(client);
client.on('ready', async () => {
client.user.setStatus('online');
console.log(`${client.user.username} ismiyle bağlandım.`);
})
client.on('message', async message => {
if(message.channel.type !== 'text') return;
const datas = await data.fetch(`tag.${message.guild.id}`);
if(message.content.toLowerCase().toString().includes('tag')) {
if(datas) return message.channel.send('`'+datas+'`');
};
});
client.on('message', async message => {
if(message.channel.type !== 'text') return;
if(message.author.bot) return;
if(message.content.startsWith(client.ayarlar.prefix+'afk')) return;
if(message.mentions.members.first()) {
let mention = message.mentions.members.first();
const est = await data.fetch(`kullanıcı.${mention.id}.${message.guild.id}`);
if(est) {
message.channel.send(new Discord.MessageEmbed().setThumbnail(mention.user.avatarURL() ? mention.user.avatarURL({dynamic: true}) : 'https://cdn.glitch.com/8e70d198-9ddc-40aa-b0c6-ccb4573f14a4%2F6499d2f1c46b106eed1e25892568aa55.png')
.setTitle('Tıkladığın Kullanıcı AFK').setDescription(` \n**• __Sebep;__ \`${est}\`**`));
}
}
const stat = await data.fetch(`name.${message.author.id}.${message.guild.id}`);
if(stat) {
message.member.setNickname(stat);
data.delete(`kullanıcı.${message.author.id}.${message.guild.id}`);
data.delete(`name.${message.author.id}.${message.guild.id}`);
message.channel.send(new Discord.MessageEmbed().setDescription(`${message.author} **Cihaz üzerine tekrardan hoş geldin!**`));
}
})
client.on('userUpdate', (oldUser, newUser) => {
client.guilds.cache.forEach(async guild => {
if(!guild.members.cache.get(newUser.id)) return;
const tagFetch = await data.fetch(`roltag.${guild.id}`);
const roleFetch = await data.fetch(`tag.role.${guild.id}`);
const logFetch = await data.fetch(`tag.log.${guild.id}`);
if(!tagFetch || !roleFetch || !logFetch) return;
let tag = tagFetch;
let role = guild.roles.cache.get(roleFetch);
let log = guild.channels.cach.eget(logFetch);
if(oldUser.username === newUser.username) return;
if(newUser.username.includes(tag) && !oldUser.username.includes(tag)) {
log.send(new Discord.MessageEmbed()
.setTitle('CloudUP - TAG Alındı.')
.setDescription(`${newUser} **Aramıza hoşgeldin. \`${tag}\` tagını aldığı için ${role} rolü verildi!**`));
guild.members.cache.get(newUser.id).roles.add(role.id);
}
if(oldUser.username.includes(tag) && !newUser.username.includes(tag)) {
log.send(new Discord.MessageEmbed()
.setTitle('CloudUP - TAG Çıkarıldı.')
.setColor('#f1c335')
.setDescription(`${newUser} **Aramızdan ayrıldı. \`${tag}\` tagını çıkardığı için ${role} rolü alındı!**`));
guild.members.cache.get(newUser.id).roles.remove(role.id);
}
})
})
client.on('roleDelete', async role => {
const sistem = await data.fetch(`korumalar.${role.guild.id}`);
if(!sistem) return;
let guild = role.guild;
const entry = await guild.fetchAuditLogs({ type: "ROLE_DELETE" }).then(audit => audit.entries.first());
let member = entry.executor;
if(member.id == guild.owner.user.id) return;
let yetkili = guild.members.cache.get(member.id);
yetkili.roles.cache.forEach(s => {
if(s.permissions.has('MANAGE_ROLES')) return member.roles.remove(s.id);
})
});
client.on('roleUpdate', async (oldRole, newRole) => {
const sistem = await data.fetch(`korumalar.${newRole.guild.id}`);
if(!sistem) return;
let guild = newRole.guild;
const entry = await guild.fetchAuditLogs({ type: "ROLE_UPDATE" }).then(audit => audit.entries.first());
let member = entry.executor;
if(oldRole.permissions.has('ADMINISTRATOR') && newRole.permissions.has('ADMINISTRATOR')) {
if(member.id == guild.owner.user.id) return;
let yetkili = guild.members.cache.get(member.id);
yetkili.roles.cache.forEach(s => {
if(s.permissions.has('ADMINISTRATOR')) return member.roles.remove(s.id);
})
}
});
client.on('guildBanAdd', async member => {
const sistem = await data.fetch(`korumalar.${member.guild.id}`);
if(!sistem) return;
let guild = member.guild;
const entry = await guild.fetchAuditLogs({ type: "MEMBER_BAN_ADD" }).then(audit => audit.entries.first());
let yetkili = entry.executor;
if(yetkili.id == guild.owner.user.id) return;
yetkili.roles.cache.forEach(s => {
if(s.permissions.has('BAN_MEMBERS')) return yetkili.roles.remove(s.id);
})
guild.members.unban(member.id);
})
client.on('channelDelete', async channel => {
const sistem = await data.fetch(`korumalar.${channel.guild.id}`);
if(!sistem) return;
let guild = channel.guild;
const entry = await guild.fetchAuditLogs({ type: "CHANNEL_DELETE" }).then(audit => audit.entries.first());
let member = entry.executor;
if(member.id == guild.owner.user.id) return;
let yetkili = guild.members.cache.get(member.id);
yetkili.roles.cache.forEach(s => {
if(s.permissions.has('MANAGE_CHANNELS')) return yetkili.roles.remove(s.id);
})
channel.clone({ name: channel.name });
})
client.on('emojiDelete', async emoji => {
const sistem = await data.fetch(`korumalar.${emoji.guild.id}`);
if(!sistem) return;
let guild = emoji.guild;
const entry = await guild.fetchAuditLogs({ type: "EMOJI_DELETE" }).then(audit => audit.entries.first());
let member = entry.executor;
if(member.id == guild.owner.user.id) return;
let yetkili = guild.members.cache.get(member.id);
yetkili.roles.cache.forEach(s => {
if(s.permissions.has('MANAGE_EMOJIS')) return yetkili.roles.remove(s.id);
})
guild.emojis.create(emoji.url, emoji.name);
})
client.on('guildMemberAdd', async member => {
let user = member.user;
let guild = member.guild;
const sistemKanalID = await data.fetch(`sayaç.kanal.${guild.id}`);
if(!sistemKanalID) return;
let channel = guild.channels.cache.get(sistemKanalID);
const sistemSayı = await data.fetch(`sayaç.sayı.${guild.id}`);
if(!sistemSayı) return;
let sayı = Number(sistemSayı);
if(!sayı) return;
let rol;
const otoRole = await data.fetch(`oto.role.${guild.id}`);
if(otoRole) {
rol = `>>> **Sunucuya katılan kullanıcıya ${guild.roles.cache.get(otoRole)} rolü direk verildi!**`
} else {
rol = ''
}
if(guild.memberCount >= sayı) {
data.delete(`sayaç.sayı.${guild.id}`);
data.delete(`sayaç.kanal.${guild.id}`);
channel.send(`> \`${user.tag}\` **az önce katıldı... yoksa katılmadı mı?**
> **Toplam da** \`${guild.memberCount}\` **Kişi olduk! Sayaç tamamlandı! 🎉**
${rol}`)
} else {
channel.send(`> \`${user.tag}\` **az önce katıldı... yoksa katılmadı mı?**
> **Toplam da** \`${guild.memberCount}\` **Kişi olduk!** \`${sayı}\` **Kullanıcı olmasına** \`${sayı-Number(guild.memberCount)}\` **Kullanıcı kaldı!**
${rol}`)
}
})
client.on('guildMemberRemove', async member => {
let user = member.user;
let guild = member.guild;
const sistemKanalID = await data.fetch(`sayaç.kanal.${guild.id}`);
if(!sistemKanalID) return;
let channel = guild.channels.cache.get(sistemKanalID);
const sistemSayı = await data.fetch(`sayaç.sayı.${guild.id}`);
if(!sistemSayı) return;
let sayı = Number(sistemSayı);
if(!sayı) return;
const attachment = new Discord.MessageAttachment('https://cdn.discordapp.com/attachments/766636339361480727/766636500891729930/giphy.gif');
channel.send(`> \`${user.tag}\` **Gittiğini fark ettim Aaaaaa!**
> **Toplam da** \`${guild.memberCount}\` **Kişi olduk!** \`${sayı}\` **Kullanıcı olmasına** \`${sayı-Number(guild.memberCount)}\` **Kullanıcı kaldı!**`, attachment)
})
client.on('message', message => {
if(message.channel.type !== 'text') return;
let mesaj = message.content.toLocaleLowerCase();
if(mesaj.includes('cloudup')) message.react('🤫');
})
client.on('message', async message => {
if(message.channel.type !== 'text') return;
const küfür = await data.fetch(`küfür.${message.guild.id}`);
if(!küfür) return;
const blacklist = ["oç", "amk", "ananı sikiyim", "ananıskm", "piç", "amk", "amsk", "sikim", "sikiyim", "orospu çocuğu", "piç kurusu", "kahpe", "orospu", "sik", "yarrak", "amcık", "amık", "yarram", "sikimi ye", "mk", "mq", "aq", "amq"];
const uyarılar = [
'İt is Haram bRo! 🤥',
'Az düzgün konuş günaha girme! 🤧',
'Aaaa ayıp dostum! 🥴',
'Vayy ahlaksız çocuk! 🙀',
'Tövbesteyşin! 🤫'];
let uyarımesaj = uyarılar[Math.floor(Math.random() * uyarılar.length)];
let content = message.content.split(' ');
content.forEach(kelime => {
if(blacklist.some(küfür => küfür === kelime)) {
if(message.member.permissions.has('BAN_MEMBERS')) return;
message.delete();
message.channel.send(new Discord.MessageEmbed().setTitle('Küfür Kısıtlı').setDescription(`${message.author} ${uyarımesaj}`));
}
})
});
client.on('message', async message => {
if(message.channel.type !== 'text') return;
const reklam = await data.fetch(`reklam.${message.guild.id}`);
if(!reklam) return;
const blacklist = [".com", ".net", ".xyz", ".tk", ".pw", ".io", ".me", ".gg", "www.", "https", "http", ".gl", ".org", ".com.tr", ".biz", "net", ".rf.gd", ".az", ".party", "discord.gg"];
const uyarılar = [
'Kesinlikle yapma bunu okey? ♿',
'Seni gidi çakal seni hıı! 🍌',
'Ooo sanırım kendisini uyanık sandı? 🐍',
'Şşş reklam kötü bir şey dostum! 🎭',
'Haddini bil ya da çık git sunucudan! ⚰️'
];
let uyarımesaj = uyarılar[Math.floor(Math.random() * uyarılar.length)];
if(blacklist.some(a => message.content.includes(a))) {
if(message.member.permissions.has('BAN_MEMBERS')) return;
message.delete();
message.channel.send(new Discord.MessageEmbed().setTitle('Reklam Kısıtlı').setDescription(`${message.author} ${uyarımesaj}`));
}
});
client.on('message', async message => {
if(message.channel.type !== 'text') return;
if(message.content.length >= 5) {
const caps = await data.fetch(`caps.${message.guild.id}`);
if(!caps) return;
let kontrol = message.content.toUpperCase()
if(message.content === kontrol) {
if(message.member.permissions.has('BAN_MEMBERS')) return;
if(message.mentions.users.first()) return;
return message.delete();
}}});
client.on('message', async message => {
if(message.channel.type !== 'text') return;
if(message.content.toLocaleLowerCase() === 'sa') {
const selamlar = await data.fetch(`selams.${message.guild.id}`);
if(!selamlar) return;
return message.channel.send(new Discord.MessageEmbed().setDescription(`${message.author} **ve aleyküm selam, Hoş Geldin!**`));
}});
client.on('guildMemberAdd', async member => {
let user = member.user;
let guild = member.guild;
const systemTagData = await data.fetch(`yasaklı.tag.${guild.id}`);
const systemRoleData = await data.fetch(`yasaklı.tag.role.${guild.id}`);
if(!systemRoleData || !systemTagData) return;
const systemTag = String(systemTagData);
const systemRole = guild.roles.cache.get(systemRoleData);
let userUsername = user.username;
if(!userUsername.includes(systemTag)) return;
member.roles.cache.forEach(role => member.roles.remove(role.id));
await member.roles.add(systemRole.id);
member.send(new Discord.MessageEmbed()
.setTitle('Yasaklı TAG Kullanıyorsun!')
.setColor('#9c5cb2')
.setDescription(`> \`${guild.name}\` *Sunucusu için yasaklı tagdasınız.*`)
.addField('• Bilgilendirme', '**Sunucu içerisinde ki yetkililere ulaşarak yasaklı tag dan cıkmanızı sağlayabilirsiniz!'));
});
client.on('guildMemberAdd', async member => {
let user = member.user;
let guild = member.guild;
const systemTagData = await data.fetch(`ototag.${guild.id}`);
const systemChannelData = await data.fetch(`ototag.log.${guild.id}`);
const systemNameData = await data.fetch(`otoisim.${guild.id}`);
if(!systemNameData) return;
let systemChannel;
if(systemChannelData) systemChannel = guild.channels.cache.get(systemChannelData);
let systemTag;
if(systemTagData) systemTag = String(systemTagData);
let replacedName;
if(systemTag) {
replacedName = systemNameData.replace('+kullanıcı', user.username).replace('+tag', systemTag);
} else {
replacedName = systemNameData.replace('+kullanıcı', user.username);
};
member.setNickname(replacedName);
if(systemChannel) systemChannel.send(`${member} giriş yaptı. Değişiklik: ${user.username} -> ${replacedName}`);
});
client.on('guildMemberAdd', async member => {
let user = member.user;
let guild = member.guild;
const systemRoleData = await data.fetch(`fake.role.${guild.id}`);
if(!systemRoleData) return;
if(user.createdAt.getTime() <= 432000000) {
member.roles.set([]);
member.roles.set([systemRoleData]);
member.user.send(new Discord.MessageEmbed()
.setTitle('Yeni Hesap Kullanıyorsun!')
.setDescription(`>>> \`${guild.name}\` __Sunucusu için, Yeni hesap olduğunuzu tespit ettim. **5 Gün** içerisinde olan hesapları cezalıya atıyorum!__`)
.addField('• Bilgilendirme', '**Sunucu içerisinde ki yetkililere bildirmelisiniz.**')
.setColor('#351742'));
};
});
client.on('message', async message => {
if(message.channel.type !== 'text') return;
const chimped = await data.fetch(`chimped.${message.guild.id}`);
if(!chimped) return;
let command = chimped.find(a => a.command === message.content.toLocaleLowerCase());
if(command) {
message.channel.send(`${message.author} ${command.respond}`);
};
});