const { Client, MessageEmbed, MessageAttachment, MessageActionRow, MessageButton } = require("discord.js"); const Canvas = require("canvas"); const { registerFont } = require("canvas"); registerFont('./MarlinGeo-Black.otf', { family: 'Marlin Geo Black' }); const path = require('path'); let cooldown = new Map(); exports.run = async (client, message, args) => { if (!message.channel.name.includes("ship")) return message.reply(`Bu Komutu Sadece ${message.guild.channels.cache.filter(x => x.name.includes("ship-chat")).map(x => x).join(", ")} kanallarında kullanabilirsiniz.`).then(x => { message.react("<:no_aze:1239614673620304047>"); setTimeout(() => { x.delete() }, 5000); }); let member = message.mentions.users.first() || message.guild.members.cache.get(args[0]); if (!member || message.author.id === member.id) { member = message.guild.members.cache .filter(m => m.id !== message.author.id) .random(); } let emoji = client.emojis.cache.find(x => x.name === "loversaze"); // sunucunda kalps adında emoji olursa gösterir const özelKullanıcılar = [""];// buraya hangi ID girersen full çıkar ikisine attığında ship let love; let emoticon; if (özelKullanıcılar.includes(member.id)) { love = 'Birbiriniz Üçün Yaradılıbsız:) 👉 👈'; emoticon = 'https://cdn.glitch.com/00963c7e-8e86-4a55-8d85-36add9e330d7%2Femoji_2.png?v=1593651528429'; } else { let replies = [ '%5', '%3', '%10', '%14', '%17', '%20', '%22', '%25', '%24', '%27', '%32', '%36', '%34', '%39', '%42', '%45', '%47', '%51', '%54', '%56', '%59', '%58', '%60', '%63', '%65', '%64', '%68', '%70', '%74', '%78', '%79', '%80', '%83', '%86', '%84', '%89', '%91', '%93', '%95', '%97', '%98', '%99', 'Birbiriniz Üçün Yaradılıbsız:) <:vicenity_kalp2:1238214554111053915> ', 'Birbiriniz Üçün Yaradılıbsız:) 👉 👈' ]; let emoti = Math.floor(Math.random() * replies.length); love = replies[emoti]; if (emoti <= 44 && emoti >= 23) { emoticon = 'https://cdn.glitch.com/00963c7e-8e86-4a55-8d85-36add9e330d7%2Femoji_2.png?v=1593651528429'; } else if (emoti < 23 && emoti >= 12) { emoticon = 'https://cdn.glitch.com/00963c7e-8e86-4a55-8d85-36add9e330d7%2Femoji_3-1.png?v=1593652255529'; } else if (emoti < 12) { emoticon = 'https://cdn.glitch.com/00963c7e-8e86-4a55-8d85-36add9e330d7%2Femoji_1.png?v=1593651511900'; } } const canvas = Canvas.createCanvas(384, 128); const ctx = canvas.getContext('2d'); const emotes = await Canvas.loadImage(emoticon); const avatar1 = await Canvas.loadImage(message.member.displayAvatarURL({ format: "png" })); const avatar2 = await Canvas.loadImage(member.displayAvatarURL({ format: "png" })); ctx.beginPath(); ctx.moveTo(0 + Number(10), 0); ctx.lineTo(0 + 384 - Number(10), 0); ctx.quadraticCurveTo(0 + 384, 0, 0 + 384, 0 + Number(10)); ctx.lineTo(0 + 384, 0 + 128 - Number(10)); ctx.quadraticCurveTo( 0 + 384, 0 + 128, 0 + 384 - Number(10), 0 + 128 ); ctx.lineTo(0 + Number(10), 0 + 128); ctx.quadraticCurveTo(0, 0 + 128, 0, 0 + 128 - Number(10)); ctx.lineTo(0, 0 + Number(10)); ctx.quadraticCurveTo(0, 0, 0 + Number(10), 0); ctx.closePath(); ctx.clip(); ctx.fillStyle = "#ffffff"; const şekilurl = 'https://cdn.discordapp.com/attachments/991754220116127915/1252299271672303656/ship.png?ex=6671b614&is=66706494&hm=52f90e0c982b03b05c7d2caf5a1559e2c76540e0075b656267421f4b972aad43&'; // const imagePath = path.resolve(__dirname, "./Assets/ship.png"); // Resmi yükleyin let background = await Canvas.loadImage(şekilurl); ctx.drawImage(background, 0, 0, 384, 129); ctx.beginPath(); ctx.globalAlpha = 0.5; ctx.fillStyle = "#000000"; //ctx.fillRect(50, 30, 980, 350); ctx.fillStyle = "#000000"; ctx.globalAlpha = 0.5; ctx.fillRect(55, 5, 275, 115); ctx.globalAlpha = 1; ctx.drawImage(avatar1, 70, 12, 100, 100); ctx.drawImage(avatar2, 215, 12, 100, 100); ctx.drawImage(emotes, 150, 20, 75, 75); const img = new MessageAttachment(canvas.toBuffer(), 'ship.png'); let Row = new MessageActionRow().addComponents( new MessageButton() .setLabel('Mesajı Sil') .setCustomId("test") .setEmoji("1239614673620304047") .setStyle(2), new MessageButton() .setStyle(2) .setLabel('Üzvə Bax') .setEmoji('👁️') .setCustomId('user') ); let Rows = new MessageActionRow().addComponents( new MessageButton() .setLabel('Mesajı Sil') .setCustomId("test") .setEmoji("1239614673620304047") .setStyle(2), new MessageButton() .setStyle(2) .setLabel('Üzvə Bax') .setEmoji('👁️') .setCustomId('user') ); if (love >= '%60') { message.reply({ components: [Rows], content: `<@${message.author.id}> **Sevgi Nisbətiniz; ${love} ${emoji} **`, files: [img] }).then(async (msg) => { var filter = (i) => i.user.id == message.member.id; let collector = msg.createMessageComponentCollector({ filter: filter, time: 25000 }); collector.on('collect', async (interaction) => { if (interaction.customId === "test") { interaction.message.delete(); message.delete(); } if (interaction.customId === "user") { Rows.components[1].setDisabled(true); msg.edit({ components: [Rows] }); interaction.reply({ content: `> ${member}`, ephemeral: true }); } }); collector.on("end", async (_, reason) => { if (reason === "time") { Rows.components[0].setDisabled(true); Rows.components[1].setDisabled(true); if (msg) msg.edit({ components: [Rows] }); } }); }); } else { message.reply({ components: [Row], content: `<@${message.author.id}> **Sevgi Nisbətiniz; ${love}**`, files: [img] }).then(async (msg) => { var filter = (i) => i.user.id == message.member.id; let collector = msg.createMessageComponentCollector({ filter: filter, time: 25000 }); collector.on('collect', async (interaction) => { if (interaction.customId === "test") { interaction.message.delete(); message.delete(); } if (interaction.customId === "user") { Row.components[1].setDisabled(true); msg.edit({ components: [Row] }); interaction.reply({ content: `> ${member}`, ephemeral: true }); } }); collector.on("end", async (_, reason) => { if (reason === "time") { Row.components[0].setDisabled(true); Row.components[1].setDisabled(true); if (msg) msg.edit({ components: [Row] }); } }); }); } } exports.conf = { enabled: true, //kullanıma açık mı değil mi guildOnly: true, //dmde kullanıma açık mı değil mi aliases: [ "ilişki"], //kısayollar permLevel: 0 //perm level mainde karşılıklar yazar }; exports.help = { name: "ship", //komutu çalıştıracak olan kelime description: "<3",//açıklama (isteğe bağlı) usage: "ship"//kullanım (isteğe bağlı) };