const { Client, GatewayIntentBits } = require('discord.js'); require('dotenv').config(); const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent] }); client.once('ready', () => { console.log(`Logged in as ${client.user.tag}!`); }); client.on('messageCreate', async message => { if (message.author.bot) return; // Komutları kontrol et if (message.content.startsWith('!kick')) { if (!message.member.permissions.has('KICK_MEMBERS')) return message.reply('You do not have permissions to kick members!'); let member = message.mentions.members.first(); if (!member) return message.reply('Please mention a valid member!'); if (!member.kickable) return message.reply('I cannot kick this user!'); await member.kick(); message.channel.send(`${member.user.tag} has been kicked!`); } if (message.content.startsWith('!ban')) { if (!message.member.permissions.has('BAN_MEMBERS')) return message.reply('You do not have permissions to ban members!'); let member = message.mentions.members.first(); if (!member) return message.reply('Please mention a valid member!'); if (!member.bannable) return message.reply('I cannot ban this user!'); await member.ban(); message.channel.send(`${member.user.tag} has been banned!`); } if (message.content.startsWith('!clear')) { if (!message.member.permissions.has('MANAGE_MESSAGES')) return message.reply('You do not have permissions to manage messages!'); let args = message.content.split(' ').slice(1); let amount = parseInt(args[0]); if (isNaN(amount) || amount <= 0 || amount > 100) return message.reply('Please provide a number between 1 and 100!'); await message.channel.bulkDelete(amount, true); message.channel.send(`Deleted ${amount} messages!`).then(msg => msg.delete({ timeout: 5000 })); } }); client.login(process.env.DISCORD_TOKEN);