Yardım Discord bot hatası

Katılım
31 Ekim 2020
Mesajlar
465
Reaksiyon puanı
196
Puanları
43
Yaş
24
Merhaba çalışıp duran bot bir anda hata vermeye başladı.
Nasıl düzeltebiliriz.
JavaScript:
const Discord = require('discord.js') // discord.js modülü tanımlıyoruz.
const { Client, MessageEmbed } = require('discord.js')
const client = new Discord.Client() // client tanımalamsı
const { readdirSync } = require('fs');

client.commands= new Discord.Collection(); // komutları alıyoruz

const prefix = "!"
const commandFiles = readdirSync(join(__dirname, "komutlar")).filter(file => file.endsWith(".js"));

for (const file of commandFiles) {
    const command = require(join(__dirname, "komutlar", `${file}`));
    client.commands.set(command.kod, command); // Komutları Ayarlıyoruz.
}


client.on("error", console.error);

client.on('ready', () => {
    client.user.setActivity('Everything')
    console.log('Botumuz Aktif')
});


client.on("message", async message => {

    if(message.author.bot) return;

    if(message.content.startsWith(prefix)) {
        const args = message.content.slice(prefix.length).trim().split(/ +/);

        const command = args.shift().toLowerCase();

        if(!client.commands.has(command)) return message.channel.send(`Komut dosyamda **${command}** adlı bir komut bulamadım.`);


        try {
            client.commands.get(command).run(client, message, args);

        } catch (error){
            console.error(error);
        }
    }
})

client.login('token')
Kodum bu hatam ise altta
Ekran Görüntüsü (29).png

Mesaj otomatik birleştirildi:

Tamam sorun çözüldü sorunu yaşayanlar için üst tanımlara

JavaScript:
const { join } = require('path');
const { readdirSync } = require('fs');
bunu ekleyeceksiniz.
 
Son düzenleme:
Üst