Published by
discord ship v14
discord.js v14 uyumlu ship(aşk oranı ölçer) komutu. Detaylı ve özel eklemeleri olan gelişmiş versiyon.
- License MIT
- Publication Date 03/09/2024 - 03:11
- Version Discord.js V14
- Command Type Prefix Commands
- Views 5
- Files 1
- Images 0
Click to see the description in this file!
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const canvafy = require("canvafy");
const { EmbedBuilder, Colors, ActionRowBuilder, ButtonStyle, ButtonBuilder } = require("discord.js");
const maleNames = ["Arda", "Mert", "Emir", "Berk", "Ege", "Kerem", "Can", "Baran", "Yiğit", "Ali", "Deniz", "Kaan", "Efe", "Burak", "Emre", "Oğuz", "Umut", "Taha", "Kuzey"]
const femaleNames = ["Elif", "Zeynep", "Ada", "Aylin", "Ela", "Defne", "Nazlı", "Selin", "Ece", "İrem", "İpek", "İlayda", "İdil"]
const songs = [
{ url: "https://www.youtube.com/watch?v=qIbQqf369QI" },
{ url: "https://www.youtube.com/watch?v=8Co83aYq9wI" },
{ url: "https://www.youtube.com/watch?v=fn0TjVY6Y1w" },
{ url: "https://www.youtube.com/watch?v=wtOHNhG0EZc" },
{ url: "https://www.youtube.com/watch?v=ScoYMC81Foc" },
{ url: "https://www.youtube.com/watch?v=ylZXC4iQAXo" },
];
async function uploadImageToImgBB(imagePath) {
const apiKey = '587eb7f3aea042da860ae0b2bd7bc76c'; // imgBB API anahtarını buraya ekle
const form = new FormData();
form.append('image', fs.createReadStream(imagePath));
try {
const response = await axios.post(`https://api.imgbb.com/1/upload?key=${apiKey}`, form, {
headers: form.getHeaders()
});
if (response.data && response.data.data && response.data.data.url) {
return response.data.data.url;
} else {
throw new Error('Resim yüklenemedi');
}
} catch (error) {
console.error('Resim yükleme hatası:', error);
throw error;
}
}
exports.run = async (client, message, args) => {
let member = message.mentions.members.first();
if (!member) return message.reply({ content: "Lütfen Birini Etiketle" });
if (member.id === message.author.id) return message.reply({ content: "Kendini Etiketleyemezsin!" });
message.reply({ content: "Lütfen Bekleyin..." }).then(async x => {
// Random gender and name selection
const isMale = Math.random() < 0.5;
const childName = isMale
? maleNames[Math.floor(Math.random() * maleNames.length)]
: femaleNames[Math.floor(Math.random() * femaleNames.length)];
const childGender = isMale ? "erkek" : "kız";
// Random marriage date (5 to 10 years in the future)
const currentYear = new Date().getFullYear();
const marriageYear = currentYear + Math.floor(Math.random() * 6) + 5;
const marriageYearTimeout = marriageYear - currentYear;
const marriageDate = `10 Şubat ${marriageYear}`;
// Random song selection
const selectedSong = songs[Math.floor(Math.random() * songs.length)];
const ship = await new canvafy.Ship()
.setAvatars(message.author.displayAvatarURL({ forceStatic: true, extension: "png" }), member.user.displayAvatarURL({ forceStatic: true, extension: "png" }))
.setBackground("image", "https://img.freepik.com/free-vector/gradient-valentine-s-day-background_23-2149242406.jpg")
.setBorder("#f0f0f0")
.setOverlayOpacity(0.5)
.build();
const shipPath = `./ship-${message.member.id}.png`;
fs.writeFileSync(shipPath, ship);
const imageURL = await uploadImageToImgBB(shipPath);
const embed = new EmbedBuilder()
.setTitle(`🚢 ${message.author.username} ve ${member.user.username} Arasındaki Aşk 🚢`)
.setDescription(`**Evlenme Tarihiniz:** \`${marriageDate} [${marriageYearTimeout} yıl sonra]\`
**Gelecekteki Çocuğunuzun Adı: ${childName} ismini veriyorum çünkü siz en çok ${childGender} çocuğu istiyorsunuz 👶**`)
.setColor(Colors.Red)
.setTimestamp()
.setImage(imageURL); // Embed içinde resmi göster
let buttons = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setStyle(ButtonStyle.Secondary)
.setLabel("Mesajı Sil")
.setEmoji("🗑️")
.setCustomId("delete"),
new ButtonBuilder()
.setStyle(ButtonStyle.Secondary)
.setLabel("İkinizin Şarkısı")
.setEmoji("🎵")
.setCustomId("song"),
new ButtonBuilder()
.setStyle(ButtonStyle.Secondary)
.setLabel("Kullanıcıyı Görüntüler")
.setEmoji("👀")
.setCustomId("view")
);
x.edit({
embeds: [embed],
components: [buttons],
content: ""
})
const filter = (interaction) => interaction.user.id === message.author.id;
const collector = message.channel.createMessageComponentCollector({ filter, time: 60000 });
collector.on("collect", async (interaction) => {
if (interaction.customId === "delete") {
await interaction.message.delete().catch(() => {});
} else if (interaction.customId === "song") {
await interaction.reply({ content: `${selectedSong.url} Şarkısını Size Layık Gördüm. <3`, ephemeral: true }).catch(() => {});
} else if (interaction.customId === "view") {
await interaction.reply({ content: `Kullanıcı: <@${member.user.id}>`, ephemeral: true }).catch(() => {});
}
});
buttons = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setStyle(ButtonStyle.Secondary)
.setLabel("Mesajı Sil")
.setEmoji("🗑️")
.setDisabled(true)
.setCustomId("delete"),
new ButtonBuilder()
.setStyle(ButtonStyle.Secondary)
.setLabel("İkinizin Şarkısı")
.setEmoji("🎵")
.setDisabled(true)
.setCustomId("song"),
new ButtonBuilder()
.setStyle(ButtonStyle.Secondary)
.setLabel("Kullanıcıyı Görüntüler")
.setEmoji("👀")
.setDisabled(true)
.setCustomId("view")
);
collector.on("end", () => {
x.edit({ components: [buttons] }).catch(() => {});
});
}).catch(() => {});
};
exports.conf = {
aliases: []
};
exports.help = {
name: "ship",
description: "Etiketlediğiniz kişiye aşk testi yapar.",
usage: `ship @etiket`,
};