Konu Değerlendirmesi:
  • 0 Oy(lar) - 0 Ortalama
  • 1
  • 2
  • 3
  • 4
  • 5
Discord Moderasyon Botu - Tam Detaylı Rehber (2026 Güncel)
#1
Merhaba arkadaşlar,
Aşağıda profesyonel bir Discord Moderasyon Botu nasıl yapılır, adım adım ve eksiksiz anlatıyorum. Verdiğin kodu temel alarak düzeltilmiş, düzenli ve genişletilebilir haliyle paylaşıyorum.

Bot Özellikleri (Mevcut + Önerilen)
Mevcut Özellikler:
  • Küfür koruma (oto sil + log)
  • Reklam koruma (discord invite + link)
  • Otorol
  • SA-AS sistemi
  • Hoş geldin / Güle güle mesajları
  • Slash komut handler
  • Modal handler
  • Anti-Crash sistemi
Ekstra Önerilen Moderasyon Komutları:
  • Ban, Kick, Mute, Unmute, Warn
  • Temiz (clear/purge)
  • Slowmode
  • Lock/Unlock kanal

1. Kurulum Adımları
  1. Klasör Oluştur → discord-moderasyon-bot
  2. Terminalde şu komutları çalıştır:
Bash

Kod:
npm init -y
npm install discord.js wio.db colors



  1. Klasör yapısı şöyle olsun:
text

Kod:
discord-moderasyon-bot/
├── index.js
├── config.json
├── handlers/
│   ├── application_commands.js
│   ├── events.js
│   └── modals.js
├── Database/
│   └── güvenlik.json
└── commands/ (sonradan ekleyeceğiz)




2. config.json
JSON

Kod:
{
  "token": "BURAYA_BOT_TOKENİNİ_YAPIŞTIR",
  "embedcolor": "#ff0000",
  "ownerID": "399269982204198912",
  "prefix": "!"
}




3. Ana Dosya (index.js) - Düzeltilmiş ve Düzenlenmiş Hali
JavaScript

Kod:
// ============================================
// Discord Moderasyon Botu - 2026 Güncel
// ============================================
const {
    Client,
    GatewayIntentBits,
    Partials,
    EmbedBuilder,
    PermissionsBitField,
    ChannelType,
} = require("discord.js");
const colors = require("colors");
const config = require("./config.json");
const { JsonDatabase } = require("wio.db");
// ==================== CLIENT ====================
const client = new Client({
    intents: [
        GatewayIntentBits.Guilds,
        GatewayIntentBits.GuildMessages,
        GatewayIntentBits.MessageContent,
        GatewayIntentBits.GuildMembers,
        GatewayIntentBits.GuildModeration,
        GatewayIntentBits.DirectMessages,
    ],
    partials: [
        Partials.Channel,
        Partials.Message,
        Partials.User,
        Partials.GuildMember,
        Partials.Reaction,
    ],
    presence: {
        activities: [{ name: "TEŞKİLAT ❤️ RUST", type: 3 }],
        status: "online",
    },
});
client.slash_commands = new Map();
client.modals = new Map();
client.db = new JsonDatabase({ databasePath: "./Database/güvenlik.json" });
// ==================== TOKEN KONTROL ====================
if (!config.token) {
    console.log("[CRASH] Token bulunamadı! config.json kontrol et.".red);
    process.exit();
}
// ==================== HANDLER YÜKLEME ====================
["application_commands", "events"].forEach(handler => {
    require(`./handlers/${handler}`)(client);
});
// ==================== KÜFÜR KORUMA ====================
const badWords = ["siktir", "fuck", "puşt", "piç", "amk", "orospu", "ibne", /* ... ekleyebilirsin */];
const badRegex = new RegExp(`\\b(${badWords.join("|")})\\b`, "i");
client.on("messageCreate", async (message) => {
    if (message.author.bot || message.channel.type !== ChannelType.GuildText) return;
    const kufurAyar = client.db.get(`küfür.${message.guild.id}`);
    if (!kufurAyar?.durum) return;
    if (badRegex.test(message.content.toLowerCase()) &&
        !message.member.permissions.has(PermissionsBitField.Flags.Administrator)) {
       
        await message.delete().catch(() => {});
       
        const warn = await message.channel.send(`<@${message.author.id}> Küfür etmek yasak!`);
        setTimeout(() => warn.delete().catch(() => {}), 4000);
        const logCh = client.channels.cache.get(kufurAyar.kanal);
        if (logCh) {
            logCh.send({
                embeds: [new EmbedBuilder()
                    .setColor(config.embedcolor)
                    .setDescription(`**Küfür Tespit Edildi**\nKullanıcı: ${message.author}\nKanal: ${message.channel}\nMesaj: \`\`\`${message.content}\`\`\``)
                ]
            });
        }
    }
});
// ==================== BOT HAZIR ====================
client.once("ready", () => {
    console.log(`✅ ${client.user.tag} başarıyla aktif!`.green);
});
client.login(config.token).catch(err => {
    console.error("[CRASH] Login hatası:".red, err);
});




4. Slash Komut Örneği (Ban Komutu)
commands/ban.js oluştur:
JavaScript

Kod:
const { SlashCommandBuilder, PermissionsBitField, EmbedBuilder } = require("discord.js");
module.exports = {
    data: new SlashCommandBuilder()
        .setName("ban")
        .setDescription("Kullanıcıyı banlar")
        .addUserOption(opt => opt.setName("kullanici").setDescription("Banlanacak kişi").setRequired(true))
        .addStringOption(opt => opt.setName("sebep").setDescription("Ban sebebi").setRequired(false)),
    async execute(interaction) {
        if (!interaction.member.permissions.has(PermissionsBitField.Flags.BanMembers)) {
            return interaction.reply({ content: "❌ Bu komutu kullanmak için yetkin yok!", ephemeral: true });
        }
        const user = interaction.options.getUser("kullanici");
        const reason = interaction.options.getString("sebep") || "Sebep belirtilmedi";
        await interaction.guild.members.ban(user, { reason });
        const embed = new EmbedBuilder()
            .setColor("Red")
            .setDescription(`**${user.tag}** kullanıcısı banlandı.\n**Sebep:** ${reason}`);
        interaction.reply({ embeds: [embed] });
    }
};




5. Handler Örnekleri (Kısaca)
handlers/application_commands.js
JavaScript

Kod:
const fs = require("fs");
module.exports = (client) => {
    const commandFiles = fs.readdirSync("./commands").filter(file => file.endsWith(".js"));
    for (const file of commandFiles) {
        const command = require(`../commands/${file}`);
        client.slash_commands.set(command.data.name, command);
    }
    client.on("interactionCreate", async interaction => {
        if (!interaction.isChatInputCommand()) return;
        const command = client.slash_commands.get(interaction.commandName);
        if (command) await command.execute(interaction);
    });
};




Nasıl Kullanılır?
  1. Tüm dosyaları oluştur.
  2. config.json'a tokenini yaz.
  3. node index.js ile çalıştır.
  4. Sunucuya / komutlarını eklemek için botu yeniden başlat.

Ekstra İsteklerin Var mı?
  • Daha fazla moderasyon komutu (mute, warn sistemi, ticket vs.)
  • Level sistemi
  • Otomatik rol verme
  • Anti-Raid koruması
Hangisini istersen hemen ekleyeyim.
Bu konuyu olduğu gibi forumuna atabilirsin.
Beğendin mi? Eksik bir yer var mı?
Juniorboss
Admin


Derin Platform Yönetimi
Bul
Yanıtla


Hızlı Erişim:


Bu Konuya Göz Atan Kullanıcılar: 1 Ziyaretçi(ler)