Gelişmiş Starboard Sistemi, Discord Botunuz İçin Discord starboard v12 Bot Kodu.
const Discord = require("discord.js"); const config = { starboardChannel: "starboard", kategori: "🌟 STARBOARD 🌟", minimumStars: 1, defaultColour: 15844367 }; module.exports.run = async (client, message, args) => { const starboard = message.guild.channels.cache.find( channel => channel.name === config.starboardChannel ); if (!starboard) { await message.guild.channels.create(config.kategori, { type: "category" }); const a = message.guild.channels.cache.find( m => m.name === config.kategori ); await message.guild.channels .create(config.starboardChannel, "text") .then(c => { return c.setParent(a.id); }); } let c = message.guild.channels.cache.find( channel => channel.name === config.starboardChannel ); let role2 = message.guild.roles.cache.find(m => m.name === "@everyone"); await c.createOverwrite(role2, { SEND_MESSAGES: false, READ_MESSAGES: true }); setTimeout(() => { return c.send( new Discord.MessageEmbed() .setColor(config.defaultColour) .setTitle("⭐ Starboard Aktif ⭐") .setThumbnail(message.guild.iconURL()) .setFooter(message.guild.name) .setTimestamp() .setDescription( `Starboard Sistemi Bu Sunucuda Aktif Edildi Artık En Az ${config.minimumStars} Adet ⭐ Tepkisi Alan Mesajlar Bu Kanala Gönderilecek! 😎` ) ); }, 3000); message.channel.send("Starboard Sistemi Başarıla Bu Sunucuda Aktif Edildi <#"+c+">") }; module.exports.conf = { enabled: true, guildOnly: false, aliases: [] }; module.exports.help = { name: "starboard" };
const config = { starboardChannel: "starboard", minimumStars: 1, defaultColour: 15844367 }; client.on("messageReactionAdd", async (reaction, user) => { console.log( reaction.message.guild.name + " İsimli Serverde " + reaction.message.channel.name + " İsimli Kanalda " + user.username + " İsimli Kişi " + reaction.message.id + " ID'li Mesaja " + reaction.emoji.name + " İsimli Emoji ile Tepki Verdi!" ); if (reaction.message.partial) await reaction.messages.fetch(); checkReaction(reaction, user, +1); }); client.on("messageReactionRemove", async (reaction, user) => { if (reaction.message.partial) await reaction.messages.fetch(); checkReaction(reaction, user, -1); }); async function checkReaction(reaction, user, starAmount) { let message = reaction.message; let image = message.attachments.size > 0 ? await extension(message.attachments.array()[0].url) : ""; if (reaction.emoji.name !== "⭐") return; if (message.author.bot) return message.channel.send( `${user} Bot Mesajları Starboard'a Dahil Değildir!` ); if (image === "" && message.cleanContent.length < 1) return message.channel.send( `${user} Boş Mesajlar Starboard'a Dahil Değildir!` ); let starboard = message.guild.channels.cache.find( channel => channel.name === config.starboardChannel ); let starCount = message.reactions.cache.get(reaction.emoji.name).count; if (starCount >= config.minimumStars) { let newEmbed = new Discord.MessageEmbed() .setColor(config.defaultColour) .setDescription(message.cleanContent) .setAuthor(message.author.tag, message.author.displayAvatarURL()) .addField("Orjinal Mesaj", `[Göster](${message.url})`) .setTimestamp(new Date()) .setFooter(`⭐ ${starCount}`); if (image) newEmbed.setImage(image); await starboard.send({ embed: newEmbed }); } } function extension(attachment) { let imageLink = attachment.split("."); let typeOfImage = imageLink[imageLink.length - 1]; let image = /(jpg|jpeg|png|gif)/gi.test(typeOfImage); if (!image) return ""; return attachment; }