const { Client, Collection, Intents } = require('discord.js'); const fs = require('fs'); const { Sequelize } = require('sequelize'); // Veritabanı bağlantısı const sequelize = new Sequelize('sqlite:./database.sqlite'); // Yeni bir Discord istemcisi oluştur const client = new Client({ intents: [Intents.FLAGS.GUILDS] }); // Komutları bir koleksiyonda sakla client.commands = new Collection(); // commands klasöründeki komut dosyalarını yükle const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); for (const file of commandFiles) { const command = require(`./commands/${file}`); // Komutu komut koleksiyonuna ekle client.commands.set(command.data.name, command); } client.once('ready', () => { console.log(`${client.user.tag} olarak giriş yapıldı!`); }); client.on('interactionCreate', async interaction => { if (!interaction.isCommand()) return; const command = client.commands.get(interaction.commandName); if (!command) return; try { await command.execute(interaction); } catch (error) { console.error(error); await interaction.reply({ content: 'Komutu çalıştırırken bir hata oluştu!', ephemeral: true }); } }); const eventFiles = fs.readdirSync('./events').filter(file => file.endsWith('.js')); for (const file of eventFiles) { const event = require(`./events/${file}`); if (event.once) { client.once(event.name, (...args) => event.execute(...args, client)); } else { client.on(event.name, (...args) => event.execute(...args, client)); } } //=====// Seste Tutma \\=====\\ const { joinVoiceChannel } = require('@discordjs/voice') const { config, env } = require('process') client.on('ready', () => { let channel = client.channels.cache.get("1215579811385319474") const VoiceConnection = joinVoiceChannel({ channelId: channel.id, guildId: channel.guild.id, adapterCreator: channel.guild.voiceAdapterCreator }); }) //=====// Seste Tutma \\=====\\ // Botun token'ı ile giriş yap client.login('burda tokebn var');