client.on("guildMemberRemove", async member => { //let resimkanal = JSON.parse(fs.readFileSync("./ayarlar/gç.json", "utf8")); //const canvaskanal = member.guild.channels.cache.get(resimkanal[member.guild.id].resim); if (db.has(`gçkanal_${member.guild.id}`) === false) return; var canvaskanal = member.guild.channels.cache.get(db.fetch(`gçkanal_${member.guild.id}`)); if (!canvaskanal) return; const request = require("node-superfetch"); const Canvas = require("canvas"), Image = Canvas.Image, Font = Canvas.Font, path = require("path"); var randomMsg = ["Sunucudan Ayrıldı."]; var randomMsg_integer = randomMsg[Math.floor(Math.random() * randomMsg.length)]; let msj = await db.fetch(`cikisM_${member.guild.id}`); if (!msj) msj = `{uye}, ${randomMsg_integer}`; const canvas = Canvas.createCanvas(1120, 630); const ctx = canvas.getContext("2d"); const background = await Canvas.loadImage( "https://cdn.discordapp.com/attachments/836177936352018493/842796473615908895/PicsArt_05-14-07.11.23.png" ); ctx.drawImage(background, 0, 0, canvas.width, canvas.height); ctx.strokeStyle = "#74037b"; ctx.strokeRect(0, 0, canvas.width, canvas.height); ctx.fillStyle = `#D3D3D3`; ctx.font = "900 90px Arial"; ctx.textAlign = "center"; ctx.fillText(`${member.user.username}`, 560, 430); let avatarURL = member.user.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) ; const { body } = await request.get(avatarURL); const avatar = await Canvas.loadImage(body); ctx.beginPath(); ctx.lineWidth = 4; ctx.fill(); ctx.lineWidth = 4; ctx.arc(472 + 91, 91 + 125, 125, 0, 2 * Math.PI, false); ctx.clip(); ctx.drawImage(avatar, 435 , 90 ,255 ,255); const attachment = new Discord.MessageAttachment( canvas.toBuffer(), "güle-güle.png" ); canvaskanal.send(attachment); canvaskanal.send( msj.replace("{uye}", member).replace("{sunucu}", member.guild.name) ); if (member.user.bot) return canvaskanal.send(`? Bu bir bot, ${member.user.tag}`); }); client.on("guildMemberAdd", async member => { if (db.has(`gçkanal_${member.guild.id}`) === false) return; var canvaskanal = member.guild.channels.cache.get(db.fetch(`gçkanal_${member.guild.id}`)); if (!canvaskanal || canvaskanal === undefined) return; const request = require("node-superfetch"); const Canvas = require("canvas"), Image = Canvas.Image, Font = Canvas.Font, path = require("path"); var randomMsg = ["Sunucuya Katıldı."]; var randomMsg_integer = randomMsg[Math.floor(Math.random() * randomMsg.length)]; let paket = await db.fetch(`pakets_${member.id}`); let msj = await db.fetch(`cikisM_${member.guild.id}`); if (!msj) msj = `{uye}, ${randomMsg_integer}`; const canvas = Canvas.createCanvas(1120, 630); const ctx = canvas.getContext("2d"); const background = await Canvas.loadImage( "https://media.discordapp.net/attachments/836177936352018493/842796473988415529/PicsArt_05-14-07.10.25.png?width=1054&height=593" ); ctx.drawImage(background, 0, 0, canvas.width, canvas.height); ctx.strokeStyle = "#74037b"; ctx.strokeRect(0, 0, canvas.width, canvas.height); ctx.fillStyle = `#D3D3D3`; ctx.font = "900 90px Arial"; ctx.textAlign = "center"; ctx.fillText(`${member.user.username}`, 560, 430); let avatarURL = member.user.displayAvatarURL({ format: 'png', dynamic: true, size: 1024 }) ; const { body } = await request.get(avatarURL); const avatar = await Canvas.loadImage(body); ctx.beginPath(); ctx.lineWidth = 4; ctx.fill(); ctx.lineWidth = 4; ctx.arc(472 + 91, 91 + 125, 125, 0, 2 * Math.PI, false); ctx.clip(); ctx.drawImage(avatar, 435 , 90 ,255 ,255); const attachment = new Discord.MessageAttachment( canvas.toBuffer(), "hosgeldin.png" ); canvaskanal.send(attachment); canvaskanal.send( msj.replace("{uye}", member).replace("{sunucu}", member.guild.name) ); if (member.user.bot) return canvaskanal.send(`? Bu bir bot, ${member.user.tag}`); });