NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

const Discord = require('discord.js');
const client = new Discord.Client();
const ayarlar = require('./ayarlar.json');
const chalk = require('chalk');
const fs = require('fs');
const moment = require('moment');
const db = require('quick.db');
const http = require('http');
const express = require('express');
const request = require('request');
require('./util/eventLoader')(client);

const app = express();
app.get("/", (request, response, req, res) => {
console.log(Date.now() + " Ping tamamdır.");
response.sendStatus(200);
res.send('Naimöe Bots');
});
app.listen(process.env.PORT);
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
console.log('Düzenle Console Log Bura!');
}, 280000);

var prefix = ayarlar.prefix;

const log = message => {
console.log(`[${moment().format('YYYY-MM-DD HH:mm:ss')}] ${message}`);
};

client.on("message", msg => {
const kzgn = client.emojis.get("512302904141545509");
const embedlul = new Discord.RichEmbed()
.setColor(0x00AE86)
.setDescription( msg.author + " Reklam Yasak Bunu Bilmiyormusun!")

const embedlulz = new Discord.RichEmbed()
.setTitle("Sunucunda " + msg.author.tag + " reklam yapıyor!")
.setColor(0x00AE86)
.setDescription("?uyar <kişi> komutu ile onu uyarabilir ya da n!kick <kişi> veya n!ban <kişi> komutlarını kullanarak onu sunucudan uzaklaştırabilirsin!")
.addField("Kullanıcının mesajı:", "**" + msg.content + "**")

if (msg.content.toLowerCase().match(/(discord.gg/)|(discordapp.com/invite/) (htpp)/g) && msg.channel.type === "text" && msg.channel.permissionsFor(msg.guild.member(client.user)).has("MANAGE_MESSAGES")) {
if(msg.member.hasPermission('BAN_MEMBERS')){
return;
} else {
msg.delete(30).then(deletedMsg => {
deletedMsg.channel.send(embedlul)
msg.guild.owner.send(embedlulz).catch(e => {
console.error(e);
});
}).catch(e => {
console.error(e);
});
};
};
})
;


client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
fs.readdir('./komutlar/', (err, files) => {
if (err) console.error(err);
log(`${files.length} komut yüklenecek.`);

files.forEach(f => {
let props = require(`./komutlar/${f}`);
log(`Yüklenen komut: ${props.help.name}.`);
client.commands.set(props.help.name, props);
props.conf.aliases.forEach(alias => {
client.aliases.set(alias, props.help.name);
});
});
});

client.reload = command => {
return new Promise((resolve, reject) => {
try {
delete require.cache[require.resolve(`./komutlar/${command}`)];
let cmd = require(`./komutlar/${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(`./komutlar/${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(`./komutlar/${command}`)];
let cmd = require(`./komutlar/${command}`);
client.commands.delete(command);
client.aliases.forEach((cmd, alias) => {
if (cmd === command) client.aliases.delete(alias);
});
resolve();
} catch (e){
reject(e);
}
});
};



////////////////////////

client.on('guildMemberAdd', member => {
let guild = member.guild;

const channel = member.guild.channels.find('name', 'giriş-çıkış');
if (!channel) return;
const embed = new Discord.RichEmbed()
.setColor('RANDOM')
.setAuthor(member.user.username, member.user.avatarURL)
.setThumbnail(member.user.avatarURL)
.setTitle(':inbox_tray: | Sunucuya katıldı!')
.setTimestamp()
channel.sendEmbed(embed);
});

client.on('guildMemberRemove', member => {
const channel = member.guild.channels.find('name', 'giriş-çıkış');
if (!channel) return;
const embed = new Discord.RichEmbed()
.setColor('RANDOM')
.setAuthor(member.user.username, member.user.avatarURL)
.setThumbnail(member.user.avatarURL)
.setTitle(':outbox_tray: | Sunucudan ayrıldı')
.setTimestamp()
channel.sendEmbed(embed);
});


////////////////////////

client.on("message", msg => {
const uyarıembed = new Discord.RichEmbed()
.setColor(0x00AE86)
.setDescription(":crown: " + msg.author + "Reklam Yapmayı Kes Seni Yetkililere Söyledim :angry: :rage: ")

const dmembed = new Discord.RichEmbed()
.setTitle("Sunucunda " + msg.author.tag + " reklam yapıyor!")
.setColor(0x00AE86)
.setDescription(" " + msg.author.tag + " Sunucunda Reklam Yapıyor k?uyar komutu ile kişiyi uyara bilir k?ban Komutu İle Kişiyi Banlayabilirsin ")
.addField("Kullanıcının mesajı:", "**" + msg.content + "**")

if (msg.content.toLowerCase().match(/(discord.gg/)|(discordapp.com/invite/)/g) && msg.channel.type === "text" && msg.channel.permissionsFor(msg.guild.member(client.user)).has("MANAGE_MESSAGES")) {
if(msg.member.hasPermission('BAN_MEMBERS')){
return;
} else {
msg.delete(30).then(deletedMsg => {
deletedMsg.channel.send(uyarıembed)
msg.guild.owner.send(dmembed).catch(e => {
console.error(e);
});
}).catch(e => {
console.error(e);
});
};
};
})


client.elevation = message => {
if(!message.guild) {
return; }
let permlvl = 0;
if (message.member.hasPermission("BAN_MEMBERS")) permlvl = 2;
if (message.member.hasPermission("ADMINISTRATOR")) permlvl = 3;
if (message.author.id === ayarlar.sahip) permlvl = 4;
return permlvl;
};

var regToken = /[wd]{24}.[wd]{6}.[wd-_]{27}/g;

client.on('warn', e => {
console.log(chalk.bgYellow(e.replace(regToken, 'that was redacted')));
});

client.on('error', e => {
console.log(chalk.bgRed(e.replace(regToken, 'that was redacted')));
});


client.login(ayarlar.token);

client.on('message', msg => {
if (msg.content.toLowerCase() === '<@531077541067227136>') {
if (!msg.guild.member(msg.author).hasPermission("BAN_MEMBERS")) {
msg.author.sendMessage(':no_entry_sign: **Yapımcımı Etiketlemeyin Lütfen**');
} else {
msg.reply(':no_entry_sign: **Yapımcımı Etiketlemeyin Lütfen **');
}
}
});


client.login(ayarlar.token);

client.on('message', msg => {
if (msg.content.toLowerCase() === '<@607204099858890783>') {
if (!msg.guild.member(msg.author).hasPermission("BAN_MEMBERS")) {
msg.author.sendMessage('**prefixim is+**');
} else {
msg.reply('**prefixim n!**');
}
}
});

client.on('message', msg => {
const reason = msg.content.split(" ").slice(1).join(" ");
if (msg.channel.name== 'destek-kanalı') {
const hatay1 = new Discord.RichEmbed()
.addField("☡ Hata ☡", `Bu Sunucuda `Destek` Adında Bir Rol Yok!`)
.setColor("RANDOM")

if (!msg.guild.roles.exists("name", "Support Team")) return msg.author.send(hatay1) + msg.guild.owner.send(hatay1);
msg.guild.createChannel(`Destek Talepleri`, 'category').then(category => {
category.setPosition(1)
let every = msg.guild.roles.find("name", "@everyone");
category.overwritePermissions(every, {
VIEW_CHANNEL: false,
SEND_MESSAGES: false,
READ_MESSAGE_HISTORY: false
})
msg.guild.createChannel(`destek-${msg.author.id}`, "text").then(c => {
c.setParent(category.id)
let role = msg.guild.roles.find("name", "Support Team");
let role2 = msg.guild.roles.find("name", "@everyone");
c.overwritePermissions(role, {
SEND_MESSAGES: true,
READ_MESSAGES: true
});
c.overwritePermissions(role2, {
SEND_MESSAGES: false,
READ_MESSAGES: false
});
c.overwritePermissions(msg.author, {
SEND_MESSAGES: true,
READ_MESSAGES: true
});

const embed = new Discord.RichEmbed()
.setColor("RANDOM")
.setAuthor(`${client.user.username} | Destek Sistemi`)
.addField(`Merhaba ${msg.author.username}!`, `Destek Ekibi burada seninle ilgilenecektir. nDestek talebini kapatmak için `${prefix}kapat` yazabilirsin.`)
.addField(`» Talep Konusu/Sebebi:`, `${msg.content}`, true)
.addField(`» Kullanıcı:`, `<@${msg.author.id}>`, true)
.setFooter(`${client.user.username} | Destek Sistemi`)
.setTimestamp();
c.send({ embed: embed });
c.send(`<@${msg.author.id}> Adlı kullanıcı "`${msg.content}`" sebebi ile destek talebi açtı! Lütfen Destek Ekibini bekle, @here`)
msg.delete()
}).catch(console.error);
})
}
});

client.on("message", message => {
if (message.content.toLowerCase().startsWith(prefix + `kapat`)) {
if (!message.channel.name.startsWith(`destek-`)) return message.channel.send(`Bu komut sadece Destek Talebi kanallarında kullanılablir!`);

var deneme = new Discord.RichEmbed()
.setColor("RANDOM")
.setAuthor(`Destek Talebi Kapatma İşlemi`)
.setDescription(`Destek talebini kapatmayı onaylamak için, n10 saniye içinde `evet` yazınız.`)
.setFooter(`${client.user.username} | Destek Sistemi`)
message.channel.send(deneme)
.then((m) => {
message.channel.awaitMessages(response => response.content === 'evet',{

max: 1,
time: 10000,
errors: ['time'],
})
.then((collected) => {
message.channel.delete();
message.guild.channels.find('name' , 'Destek Talepleri').delete()


})
.catch(() => {
m.edit('Destek Talebi kapatma isteğin zaman aşımına uğradı!').then(m2 => {
m2.delete();
}, 3000);
});
});
}
});
client.login(ayarlar.token);

client.on('message', msg => {
if (msg.content.toLowerCase() === '<@580816888159010816>') {
if (!msg.guild.member(msg.author).hasPermission("BAN_MEMBERS")) {
msg.author.sendMessage(':no_entry_sign: **Ebrar Adlı Kısıyi Etiketlemek Yasak**');
} else {
msg.reply(':no_entry_sign: **Ebrar Adlı Kişiyi Etiketlemek Yasak **');
}
}
});

client.on('message', msg => {
if (msg.content.toLowerCase() === 'nususu') {
if (!msg.guild.member(msg.author).hasPermission("BAN_MEMBERS")) {
msg.author.sendMessage('**Botu Sunucuna Ekle https://discordapp.com/api/oauth2/authorize?client_id=607204099858890783&permissions=0&scope=botn Destek Sunucum https://discord.gg/8cWASkG**');
} else {
msg.reply('**Botu Sunucuna Ekle https://discordapp.com/api/oauth2/authorize?client_id=607204099858890783&permissions=0&scope=botn Destek Sunucum https://discord.gg/8cWASkG**');
}
}
});

client.on('message', async message => {
const ms = require('ms');
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
let u = message.mentions.users.first() || message.author;
if (command === "sunucu-kur") {
if (message.guild.channels.find(channel => channel.name === "Bot Kullanımı")) return message.channel.send(" Bot Paneli Zaten Ayarlanmış.")
message.channel.send(`Bot Bilgi Kanallarının kurulumu başlatılsın mı? başlatılacak ise **evet** yazınız.`)
if (!message.member.hasPermission('ADMINISTRATOR'))
return message.channel.send(" Bu Kodu `Yönetici` Yetkisi Olan Kişi Kullanabilir.");
message.channel.awaitMessages(response => response.content === 'evet', {
max: 1,
time: 10000,
errors: ['time'],
})
.then((collected) => {
message.guild.createChannel('|▬▬|ÖNEMLİ KANALLAR|▬▬|', 'category', [{
id: message.guild.id,
deny: ['SEND_MESSAGES']
}])




message.guild.createChannel('「📃」kurallar', 'text', [{
id: message.guild.id,
deny: ['SEND_MESSAGES']
}])
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|ÖNEMLİ KANALLAR|▬▬|")));
message.guild.createChannel('「🚪」gelen-giden', 'text', [{
id: message.guild.id,
deny: ['SEND_MESSAGES']
}])
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|ÖNEMLİ KANALLAR|▬▬|")));
message.guild.createChannel('「✅」sayaç', 'text', [{
id: message.guild.id,
deny: ['SEND_MESSAGES']
}])
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|ÖNEMLİ KANALLAR|▬▬|")));
message.guild.createChannel('「💾」log-kanalı', 'text', [{
id: message.guild.id,
deny: ['SEND_MESSAGES']
}])
.then(channel => channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|ÖNEMLİ KANALLAR|▬▬|")));
message.guild.createChannel('「📢」duyuru-odası', 'text', [{
id: message.guild.id,
deny: ['SEND_MESSAGES']
}])
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|ÖNEMLİ KANALLAR|▬▬|")));

})
.then((collected) => {
message.guild.createChannel('|▬▬|GENEL KANALLAR|▬▬|', 'category', [{
id: message.guild.id,
}]);

message.guild.createChannel(`「💡」şikayet-ve-öneri`, 'text')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|GENEL KANALLAR|▬▬|")));
message.guild.createChannel(`「👥」pre-arama-odası`, 'text')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|GENEL KANALLAR|▬▬|")));
message.guild.createChannel(`「📷」görsel-içerik`, 'text')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|GENEL KANALLAR|▬▬|")));
message.guild.createChannel(`「🤖」bot-komutları`, 'text')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|GENEL KANALLAR|▬▬|")));
message.guild.createChannel(`「💬」sohbet`, 'text')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|GENEL KANALLAR|▬▬|")));

message.guild.createChannel(`🏆》Kurucu Odası`, "voice")
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|SES KANALLARI|▬▬|")))
.then(c => {
let role = message.guild.roles.find("name", "@everyone");
let role2 = message.guild.roles.find("name", "Kurucu");

c.overwritePermissions(role, {
CONNECT: false,
});
c.overwritePermissions(role2, {
CONNECT: true,

});
})

message.guild.createChannel('|▬▬|SES KANALLARI|▬▬|', 'category', [{
id: message.guild.id,
}]);

message.guild.createChannel(`🏆》Yönetici Odası`, "voice")
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|SES KANALLARI|▬▬|")))
.then(c => {
let role = message.guild.roles.find("name", "@everyone");
let role2 = message.guild.roles.find("name", "Kurucu");
let role3 = message.guild.roles.find("name", "Yönetici");
c.overwritePermissions(role, {
CONNECT: false,
});
c.overwritePermissions(role2, {
CONNECT: true,
});
c.overwritePermissions(role3, {
CONNECT: true,
});
})

message.guild.createChannel(`💬》Sohbet Odası`, "voice")
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|SES KANALLARI|▬▬|")))
.then(c => {
let role = message.guild.roles.find("name", "@everyone");
c.overwritePermissions(role, {
CONNECT: true,
});
})

message.guild.createChannel('|▬▬|OYUN ODALARI|▬▬|', 'category', [{
id: message.guild.id,
}]);

message.guild.createChannel(`🎮》LOL`, 'voice')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|OYUN ODALARI|▬▬|")))
message.guild.createChannel(`🎮》ZULA`, 'voice')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|OYUN ODALARI|▬▬|")))
message.guild.createChannel(`🎮》COUNTER STRİKE`, 'voice')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|OYUN ODALARI|▬▬|")))
message.guild.createChannel(`🎮》PUBG`, 'voice')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|OYUN ODALARI|▬▬|")))
message.guild.createChannel(`🎮》FORTNİTE`, 'voice')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|OYUN ODALARI|▬▬|")))
message.guild.createChannel(`🎮》MİNECRAFT`, 'voice')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|OYUN ODALARI|▬▬|")))
message.guild.createChannel(`🎮》ROBLOX`, 'voice')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|OYUN ODALARI|▬▬|")))
message.guild.createChannel(`🎮》WOLFTEAM`, 'voice')
.then(channel =>
channel.setParent(message.guild.channels.find(channel => channel.name === "|▬▬|OYUN ODALARI|▬▬|")))



message.guild.createRole({
name: 'Kurucu',
color: 'RED',
permissions: [
"ADMINISTRATOR",
]
})


message.guild.createRole({
name: 'Yönetici',
color: 'BLUE',
permissions: [
"MANAGE_GUILD",
"MANAGE_ROLES",
"MUTE_MEMBERS",
"DEAFEN_MEMBERS",
"MANAGE_MESSAGES",
"MANAGE_NICKNAMES",
"KICK_MEMBERS"
]
})

message.guild.createRole({
name: 'Moderatör',
color: 'GREEN',
permissions: [
"MANAGE_GUILD",
"MANAGE_ROLES",
"MUTE_MEMBERS",
"DEAFEN_MEMBERS",
"MANAGE_MESSAGES",
"MANAGE_NICKNAMES"
]
})

message.guild.createRole({
name: 'V.I.P',
color: '00ffff',
})

message.guild.createRole({
name: 'Üye',
color: 'WHITE',
})

message.guild.createRole({
name: 'Bot',
color: 'ORANGE',
})

message.channel.send("Gerekli Odalar Kuruldu!")

})

}
});


const YouTube = require('simple-youtube-api');
const ytdl = require('ytdl-core');
const youtube = new YouTube('AIzaSyCkT_L10rO_NixDHNjoAixUu45TVt0ES-s');
const queue = new Map();

client.on('message', async msg => {

if (msg.author.bot) return undefined;

const args = msg.content.split(' ');
const searchString = args.slice(1).join(' ');
const url = args[1] ? args[1].replace(/<(.+)>/g, '$1') : '';
const serverQueue = queue.get(msg.guild.id);
let command = msg.content.toLowerCase().split(' ')[0];

if (command === '-çal') {
const voiceChannel = msg.member.voiceChannel;
if (!voiceChannel) return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('RANDOM')
.setDescription('❎ | Lütfen Seli Bir Kanala Giriş Yapınız!'));
const permissions = voiceChannel.permissionsFor(msg.client.user);
if (!permissions.has('CONNECT')) {
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('RANDOM')
.setTitle('❎ | Lütfen Seli Bir Kanala Giriş Yapınız!'));
}
if (!permissions.has('SPEAK')) {
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('RANDOM')
.setTitle('❎ | Şarkıyı Çalamıyorum Bu Kanalda Konuşma Yetkim Yok!'));
}

if (url.match(/^https?://(www.youtube.com|youtube.com)/playlist(.*)$/)) {
const playlist = await youtube.getPlaylist(url);
const videos = await playlist.getVideos();
for (const video of Object.values(videos)) {
const video2 = await youtube.getVideoByID(video.id); // eslint-disable-line no-await-in-loop
await handleVideo(video2, msg, voiceChannel, true); // eslint-disable-line no-await-in-loop
}
return msg.channel.sendEmbed(new Discord.RichEmbed)
.setTitle(`✅** | **${playlist.title}** Adlı Şarkı Kuyruğa Eklendi!**`)
} else {
try {
var video = await youtube.getVideo(url);
} catch (error) {
try {
var videos = await youtube.searchVideos(searchString, 10);
let index = 0;

msg.channel.sendEmbed(new Discord.RichEmbed()
.setTitle('Şarkı Seçimi')
.setDescription(`${videos.map(video2 => `**${++index} -** ${video2.title}`).join('n')}`)
.setFooter('Lütfen 1-10 Arasında Bir Rakam Seçiniz 10 Saniye İçinde Liste İptal Edilecektir!')
.setFooter('Örnek Kullanım 1')
.setColor('0x36393E'));
msg.delete(5000)
try {
var response = await msg.channel.awaitMessages(msg2 => msg2.content > 0 && msg2.content < 11, {
maxMatches: 1,
time: 10000,
errors: ['time']
});
} catch (err) {
console.error(err);
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('0x36393E')
.setDescription('❎ | **10 Saniye İçinde Şarkı Seçmediğiniz İçin seçim İptal Edilmiştir!**.'));
}
const videoIndex = parseInt(response.first().content);
var video = await youtube.getVideoByID(videos[videoIndex - 1].id);
} catch (err) {
console.error(err);
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('0x36393E')
.setDescription('❎ | YouTubede Böyle Bir Şarkı Yok !**'));
}
}
return handleVideo(video, msg, voiceChannel);

}
} else if (command === '-katıl') {
return new Promise((resolve, reject) => {
const voiceChannel = msg.member.voiceChannel;
if (!voiceChannel || voiceChannel.type !== 'voice') return msg.reply('Kanalda Kimse Olmadığından Çıkıyorum!');
voiceChannel.join().then(connection => resolve(connection)).catch(err => reject(err));
});
} else if (command === '-geç') {
if (!msg.member.voiceChannel) if (!msg.member.voiceChannel) return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('RANDOM')
.setDescription('❎ | Lütfen Seli Bir Kanala Giriş Yapınız!'));
if (!serverQueue) return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('RANDOM')
.setTitle('❎ **Şu An Zaten Şarkı Çalmıyorum!'));
serverQueue.connection.dispatcher.end('**Sıradaki Şarkıya Geçildi!**');
return undefined;
} else if (command === '-durdur') {
if (!msg.member.voiceChannel) if (!msg.member.voiceChannel) return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('RANDOM')
.setDescription('❎ | Lütfen Seli Bir Kanala Giriş Yapınız!'));
if (!serverQueue) return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('RANDOM')
.setTitle('❎ | Şu An Zaten Şarkı Çalmıyorum!'));
msg.channel.send(`:stop_button: **${serverQueue.songs[0].title}** Adlı Şarkı Durduruldu`);
serverQueue.songs = [];
serverQueue.connection.dispatcher.end('**Şarkı Bitti**');
return undefined;
} else if (command === '-ses') {
if (!msg.member.voiceChannel) if (!msg.member.voiceChannel) return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('RANDOM')
.setDescription('❎ | Lütfen Seli Bir Kanala Giriş Yapınız!'));
if (!serverQueue) return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('RANDOM')
.setTitle('❎ | Çalmayan Müziğin Sesine Bakamam'));
if (!args[1]) return msg.channel.sendEmbed(new Discord.RichEmbed()
.setTitle(`:loud_sound: Şuanki Ses Seviyesi: **${serverQueue.volume}**`)
.setColor('RANDOM'))
serverQueue.volume = args[1];
serverQueue.connection.dispatcher.setVolumeLogarithmic(args[1] / 5);
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setTitle(`:loud_sound: Ses Seviyesi Ayarlanıyor: **${args[1]}**`)
.setColor('RANDOM'));
} else if (command === '-çalan') {
if (!serverQueue) return msg.channel.sendEmbed(new Discord.RichEmbed()
.setTitle("❎ | Şu An Şarkı Çalınmıyor!")
.setColor('RANDOM'));
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('RANDOM')
.setTitle("Çalan")
.addField('Başlık', `[${serverQueue.songs[0].title}](${serverQueue.songs[0].url})`, true)
.addField("Süre", `${serverQueue.songs[0].durationm}:${serverQueue.songs[0].durations}`, true))
} else if (command === '-sıra') {
let index = 0;
if (!serverQueue) return msg.channel.sendEmbed(new Discord.RichEmbed()
.setTitle("❎ | **Şarkı Kuyruğunda Şarkı Bulunmamakta**")
.setColor('RANDOM'));
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setColor('RANDOM')
.setTitle('Şarkı Kuyruğu')
.setDescription(`${serverQueue.songs.map(song => `**${++index} -** ${song.title}`).join('n')}`))
.addField('Şu Anda Çalınan: ' + `${serverQueue.songs[0].title}`);
} else if (command === '-duraklat') {
if (serverQueue && serverQueue.playing) {
serverQueue.playing = false;
serverQueue.connection.dispatcher.pause();
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setTitle("**:pause_button: Şarkı Durduruldu!**")
.setColor('RANDOM'));
}
return msg.channel.send('❎ | **Şarkı Çalmıyor Şu An**');
} else if (command === '-devam') {
if (serverQueue && !serverQueue.playing) {
serverQueue.playing = true;
serverQueue.connection.dispatcher.resume();
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setTitle("**:arrow_forward: Şarkı Devam Ediyor!**")
.setColor('RANDOM'));
}
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setTitle("**❎ | Şu An Şarkı Çalınmıyor!**")
.setColor('RANDOM'));
}


return undefined;
});


async function handleVideo(video, msg, voiceChannel, playlist = false) {
const serverQueue = queue.get(msg.guild.id);
console.log(video);
const song = {
id: video.id,
title: video.title,
url: `https://www.youtube.com/watch?v=${video.id}`,
durationh: video.duration.hours,
durationm: video.duration.minutes,
durations: video.duration.seconds,
views: video.views,
};
if (!serverQueue) {
const queueConstruct = {
textChannel: msg.channel,
voiceChannel: voiceChannel,
connection: null,
songs: [],
volume: 5,
playing: true
};
queue.set(msg.guild.id, queueConstruct);

queueConstruct.songs.push(song);

try {
var connection = await voiceChannel.join();
queueConstruct.connection = connection;
play(msg.guild, queueConstruct.songs[0]);
} catch (error) {
console.error(`❎ | **Şarkı Sisteminde Problem Var Hata Nedeni: ${error}**`);
queue.delete(msg.guild.id);
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setTitle(`❎ | **Şarkı Sisteminde Problem Var Hata Nedeni: ${error}**`)
.setColor('RANDOM'))
}
} else {
serverQueue.songs.push(song);
console.log(serverQueue.songs);
if (playlist) return undefined;
return msg.channel.sendEmbed(new Discord.RichEmbed()
.setTitle(`✅ | **${song.title}** Adlı Şarkı Kuyruğa Eklendi!`)
.setColor('RANDOM'))
}
return undefined;
}

function play(guild, song) {
const serverQueue = queue.get(guild.id);

if (!song) {
serverQueue.voiceChannel.leave();
queue.delete(guild.id);
return;
}
console.log(serverQueue.songs);

const dispatcher = serverQueue.connection.playStream(ytdl(song.url))
.on('end', reason => {
if (reason === '❎ | **Yayın Akış Hızı Yeterli Değil.**') console.log('Şarkı Bitti.');
else console.log(reason);
serverQueue.songs.shift();
play(guild, serverQueue.songs[0]);
})
.on('error', error => console.error(error));
dispatcher.setVolumeLogarithmic(serverQueue.volume / 5);

serverQueue.textChannel.sendEmbed(new Discord.RichEmbed()
.setTitle("**🎙 Şarkı Başladı**",`https://i.hizliresim.com/RDm4EZ.png`)
.setThumbnail(`https://i.ytimg.com/vi/${song.id}/default.jpg?width=80&height=60`)
.addField('nBaşlık', `[${song.title}](${song.url})`, true)
.addField("nSes Seviyesi", `${serverQueue.volume}%`, true)
.addField("Süre", `${song.durationm}:${song.durations}`, true)
.setColor('RANDOM'));
}

client.on("message", message => {
const dmchannel = client.channels.find("name", "özelmesaj-log");
if (message.channel.type === "dm") {
if (message.author.bot) return;
dmchannel.sendMessage("", {embed: {
color: 3447003,
title: `Gönderen: ${message.author.tag}`,
description: `Bota Özelden Gönderilen DM: ${message.content}`
}})
}
});


client.on("message", async msg => {
if (msg.channel.type === "dm") return;
if(msg.author.bot) return;
if (msg.content.length > 4) {
if (db.fetch(`capslock_${msg.guild.id}`)) {
let caps = msg.content.toUpperCase()
if (msg.content == caps) {
if (!msg.member.hasPermission("ADMINISTRATOR")) {
if (!msg.mentions.users.first()) {
msg.delete()
return msg.channel.send(`✋ ${msg.author}, Bu sunucuda, büyük harf kullanımı engellenmekte!`).then(m => m.delete(5000))
}
}
}
}
}
});





client.on("guildMemberAdd", async member => {

let sayac = await db.fetch(`sayac_${member.guild.id}`);
let skanal9 = await db.fetch(`sayacK_${member.guild.id}`);
if (!skanal9) return;
const skanal31 = member.guild.channels.find('name', skanal9)
if (!skanal31) return;
skanal31.send(`:inbox_tray: - ${member.user.tag} sunucuya katıldı, ${sayac} kişi olmamıza ${sayac - member.guild.members.size} kişi kaldı.`)

});


client.on("message", async message => {
if (message.guild.id === "264445053596991498") return; // ben burayı discord bot listte çalışmasın die yaptım
const args = message.content.split(' ')
if (message.isMentioned(client.users.get('bot id'))){

if (message.author.bot) return;
if (message.channel.type == 'dm') return;
let command = args[1]
let params = message.content.split(' ').slice(2);
let perms = client.elevation(message);
let cmd;
if (client.commands.has(command)) {
cmd = client.commands.get(command);
} else if (client.aliases.has(command)) {
cmd = client.commands.get(client.aliases.get(command));
}
if (cmd) {
if (perms < cmd.conf.permLevel) return;
cmd.run(client, message, params, perms);
}
}
})


client.on("message", async msg => {


const i = await db.fetch(`ssaass_${msg.guild.id}`);
if (i == 'acik') {
if (msg.content.toLowerCase() == 'sa' || msg.content.toLowerCase() == 's.a' || msg.content.toLowerCase() == 'selamun aleyküm') {
try {

return msg.reply('Aleyküm Selam, Hoşgeldin')
} catch(err) {
console.log(err);
}
}
}
else if (i == 'kapali') {

}
if (!i) return;

});


client.on('guildDelete', guild => {

let rrrsembed = new Discord.RichEmbed()

.setColor("RED")
.setTitle(" Bot Kickledi :outbox_tray: ")
.addField(":pencil2: | Sunucu Adı:", guild.name)
.addField(":key: | Sunucu sahibi", guild.owner)
.addField(":id: | Sunucu Sahibi'nin ID'si", guild.ownerID)
.addField(":white_large_square: | Sunucunun Kurulu Olduğu Bölge:", guild.region)
.addField(":straight_ruler: | Sunucudaki Kişi Sayısı:", guild.memberCount)

client.channels.get('ID').send(rrrsembed);

});




client.on('guildCreate', guild => {

let rrrsembed = new Discord.RichEmbed()

.setColor("GREEN")
.setTitle(" Bot Eklendi :inbox_tray: ")
.addField(":pencil2: | Sunucu Adı:", guild.name)
.addField(":key: | Sunucu Sahibi", guild.owner)
.addField(":id: | Sunucu Sahibi'nin ID'si", guild.ownerID)
.addField(":white_large_square: | Sunucunun Kurulu Olduğu Bölge:", guild.region)
.addField(":straight_ruler: | Sunucudaki Kişi Sayısı:", guild.memberCount)

client.channels.get('ID').send(rrrsembed);

});


client.on("message", async message => {
if (message.guild.id === "264445053596991498") return; // ben burayı discord bot listte çalışmasın die yaptım
const args = message.content.split(' ')
if (message.isMentioned(client.users.get('bot id'))){

if (message.author.bot) return;
if (message.channel.type == 'dm') return;
let command = args[1]
let params = message.content.split(' ').slice(2);
let perms = client.elevation(message);
let cmd;
if (client.commands.has(command)) {
cmd = client.commands.get(command);
} else if (client.aliases.has(command)) {
cmd = client.commands.get(client.aliases.get(command));
}
if (cmd) {
if (perms < cmd.conf.permLevel) return;
cmd.run(client, message, params, perms);
}
}
})


client.on("guildMemberAdd", async member => {

let sayac = await db.fetch(`sayac_${member.guild.id}`);
let skanal9 = await db.fetch(`sayacK_${member.guild.id}`);
if (!skanal9) return;
const skanal31 = member.guild.channels.find('name', skanal9)
if (!skanal31) return;
skanal31.send(`:inbox_tray: - ${member.user.tag} sunucuya katıldı, ${sayac} kişi olmamıza ${sayac - member.guild.members.size} kişi kaldı.`)

});




client.on("guildMemberRemove", async member => {

let sayac = await db.fetch(`sayac_${member.guild.id}`);
let skanal9 = await db.fetch(`sayacK_${member.guild.id}`);
if (!skanal9) return;
const skanal31 = member.guild.channels.find('name', skanal9)
if (!skanal31) return;


skanal31.send(`:inbox_tray:**${member.user.tag}** adlı kullanıcı sunucudan ayrıldı. **${sayac}** kullanıcı olmaya **${sayac - member.guild.members.size}** kullanıcı kaldı.`)

});


client.on("message", async message => {

if(message.content.startsWith(prefix)) return;
if(message.author.bot) return;

var id = message.author.id;
var gid = message.guild.id;

var xp = await db.fetch(`xp_${id}_${gid}`);
var lvl = await db.fetch(`lvl_${id}_${gid}`);
var xpToLvl = await db.fetch(`xpToLvl_${id}_${gid}`);


if(!lvl) {

db.set(`xp_${id}_${gid}`, 5);
db.set(`lvl_${id}_${gid}`, 1);
db.set(`xpToLvl_${id}_${gid}`, 100);

} else {

var random = Math.random() * (8 - 3) + 3;
db.add(`xp_${id}_${gid}`, random.toFixed());
console.log(xp);

if(xp > xpToLvl) {

db.add(`lvl_${id}_${gid}`, 1);
db.add(`xpToLvl_${id}_${gid}`, await db.fetch(`lvl_${id}_${gid}`) * 100);
var lvl = await db.fetch(`lvl_${id}_${gid}`);
message.channel.send("Tebrikler, " + message.author + ". Seviye atladın! Yeni seviyen: **" + lvl + "**");
var role = message.guild.roles.get(await db.fetch(`role_${gid}_${lvl}seviye`));
if(!role) return;
else {
message.member.addRole(role);
message.channel.send("Tebrikler! **" + lvl + "** seviye olarak @" + role.name + " rolünü kazandınız.");
}

}

}



});



client.on("messageDelete", async message => {

if (message.author.bot) return;

var user = message.author;

var kanal = await db.fetch(`modlogK_${message.guild.id}`)
if (!kanal) return;
var kanal2 = message.guild.channels.find('name', kanal)

const embed = new Discord.RichEmbed()
.setColor("RANDOM")
.setAuthor(`Bir Mesaj Silindi!`, message.author.avatarURL)
.addField("Kullanıcı Tag", message.author.tag, true)
.addField("ID", message.author.id, true)
.addField("Silinen Mesaj", "```" + message.content + "```")
.setThumbnail(message.author.avatarURL)
kanal2.send(embed);

});

client.on("messageUpdate", async (oldMsg, newMsg) => {

if (oldMsg.author.bot) return;

var user = oldMsg.author;

var kanal = await db.fetch(`modlogK_${oldMsg.guild.id}`)
if (!kanal) return;
var kanal2 = oldMsg.guild.channels.find('name', kanal)

const embed = new Discord.RichEmbed()
.setColor("RANDOM")
.setAuthor(`Bir Mesaj Düzenlendi!`, oldMsg.author.avatarURL)
.addField("Kullanıcı Tag", oldMsg.author.tag, true)
.addField("ID", oldMsg.author.id, true)
.addField("Eski Mesaj", "```" + oldMsg.content + "```")
.addField("Yeni Mesaj", "```" + newMsg.content + "```")
.setThumbnail(oldMsg.author.avatarURL)
kanal2.send(embed);

});

client.on("roleCreate", async role => {

var kanal = await db.fetch(`modlogK_${role.guild.id}`)
if (!kanal) return;
var kanal2 = role.guild.channels.find('name', kanal)

const embed = new Discord.RichEmbed()
.setColor("RANDOM")
.setAuthor(`Bir Rol Oluşturuldu!`, role.guild.iconURL)
.addField("Rol", ``${role.name}``, true)
.addField("Rol Rengi Kodu", `${role.hexColor}`, true)
kanal2.send(embed);

});

client.on("roleDelete", async role => {

var kanal = await db.fetch(`modlogK_${role.guild.id}`)
if (!kanal) return;
var kanal2 = role.guild.channels.find('name', kanal)

const embed = new Discord.RichEmbed()
.setColor("RANDOM")
.setAuthor(`Bir Rol Kaldırıldı!`, role.guild.iconURL)
.addField("Rol", ``${role.name}``, true)
.addField("Rol Rengi Kodu", `${role.hexColor}`, true)
kanal2.send(embed);

});

client.on("roleUpdate", async role => {

if (!log[role.guild.id]) return;

var kanal = await db.fetch(`modlogK_${role.guild.id}`)
if (!kanal) return;
var kanal2 = role.guild.channels.find('name', kanal)

const embed = new Discord.RichEmbed()
.setColor("RANDOM")
.setAuthor(`Bir Rol Güncellendi!`, role.guild.iconURL)
.addField("Rol", ``${role.name}``, true)
.addField("Rol Rengi Kodu", `${role.hexColor}`, true)
kanal2.send(embed);

});

client.on('voiceStateUpdate', async (oldMember, newMember) => {



var kanal = await db.fetch(`modlogK_${oldMember.guild.id}`)
if (!kanal) return;
var kanal2 = oldMember.guild.channels.find('name', kanal)

let newUserChannel = newMember.voiceChannel
let oldUserChannel = oldMember.voiceChannel

if(oldUserChannel === undefined && newUserChannel !== undefined) {

const embed = new Discord.RichEmbed()
.setColor("GREEN")
.setDescription(`**${newMember.user.tag}** adlı kullanıcı `${newUserChannel.name}` isimli sesli kanala giriş yaptı!`)
kanal2.send(embed);

} else if(newUserChannel === undefined){

const embed = new Discord.RichEmbed()
.setColor("RED")
.setDescription(`**${newMember.user.tag}** adlı kullanıcı bir sesli kanaldan çıkış yaptı!`)
kanal2.send(embed);

}

client.on('channelCreate', async (channel,member) => {
var kanal = await db.fetch(`modlogK_${member.guild.id}`)
const hgK = member.guild.channels.find('name', kanal)
if (!hgK) return;
if (!channel.guild) return;
if (channel.type === "text") {
var embed = new Discord.RichEmbed()
.setColor(3066993)
.setAuthor(channel.guild.name, channel.guild.iconURL)
.setDescription(`<#${channel.id}> kanalı oluşturuldu. _(metin kanalı)_`)
.setFooter(`ID: ${channel.id}`)
embed.send(embed);
};
if (channel.type === "voice") {
var embed = new Discord.RichEmbed()
.setColor(3066993)
.setAuthor(channel.guild.name, channel.guild.iconURL)
.setDescription(`${channel.name} kanalı oluşturuldu. _(sesli kanal)_`)
.setFooter(`ID: ${channel.id}`)
hgK.send({embed});
}

})

client.on('channelDelete', async channel => {
const fs = require('fs');
var kanal = await db.fetch(`modlogK_${channel.guild.id}`)

const hgK = channel.guild.channels.find('name', kanal)
if (!hgK) return;
if (channel.type === "text") {
let embed = new Discord.RichEmbed()
.setColor(3066993)
.setAuthor(channel.guild.name, channel.guild.iconURL)
.setDescription(`${channel.name} kanalı silindi. _(metin kanalı)_`)
.setFooter(`ID: ${channel.id}`)
hgK.send({embed});
};
if (channel.type === "voice") {
let embed = new Discord.RichEmbed()
.setColor(3066993)
.setAuthor(channel.guild.name, channel.guild.iconURL)
.setDescription(`${channel.name} kanalı silindi. _(sesli kanal)_`)
.setFooter(`ID: ${channel.id}`)
hgK.send({embed});
}

});

});
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.