Discord.js Identifier client has already been declared hatası

METE_Darkness

Picopat
Katılım
29 Eylül 2023
Mesajlar
5
Daha fazla  
Cinsiyet
Erkek
Bu hatayi nasıl duzeltebilirim?
kodlar:

const { client, GatewayIntentBits, Partials, REST, Routes } =require('discord.js');
const { token, botID } = require('./config.json');
const client = new client({
intents: [
GatewayIntentBits.Guilds, // Sunucu verilerini çekmek içindir
GatewayIntentBits.GuildBans, // Sunucu Ban verilerini çekmek içindir
GatewayIntentBits.GuildEmojisAndStickers, // Sunucu Emoji ve Sticker verisini çekmek içindir
GatewayIntentBits.GuildIntegrations, // Sunucu Entagrasyon verisini çekmek içindir
GatewayIntentBits.GuildInvites, // Sunucu Davet verisini çekmek içindir
GatewayIntentBits.GuildMembers, // Sunucu Üye verisini çekmek içindir
GatewayIntentBits.GuildMessageReactions, // Sunucu Mesaj Tepki verisini çekmek içindir
GatewayIntentBits.GuildMessageTyping, // Sunucu Mesaj Yazma verisini çekmek içindir
GatewayIntentBits.GuildMessages, // Sunucu Mesaj verilerini çekmek içindir
GatewayIntentBits.GuildPresences, // Sunucu Durum verisini çekmek içindir
GatewayIntentBits.GuildScheduledEvents, // Sunucu Etkinlikler verisini çekmek içindir
GatewayIntentBits.GuildVoiceStates, // Sunucu Ses verilerini çekmek içindir
GatewayIntentBits.GuildWebhooks, // Sunucu webhook verilerini çekmek içindir
GatewayIntentBits.DirectMessages, // DM Mesaj verilerini çekmek içindir
GatewayIntentBits.DirectMessageTyping, // DM Mesaj Yazma verisini çekmek içindir
GatewayIntentBits.DirectMessageReactions, // DM Mesaj Tepki verisini çekmek içindir
GatewayIntentBits.MessageContent, // Mesaj verisini çekmek içindir
],
partials: [
Partials.User, // Üye verisini çekmek içindir
Partials.Message, // Mesaj verisini çekmek içindir
Partials.GuildMember, // Suncuu üye verisini çekmek içindir
Partials.ThreadMember, // Altbaşlık verisini çekmek içindir
],
});
const rest = new REST({version: "14.14.1"}).setToken(token);
(async () =>{
try{
await rest.put(Routes.applicationCommands(botID), { body: commands});
console.log('komutlar Yuklendi ');
} catch (error){
console.log(error);
}
})();
(client).login(token).then(() => {
console.log('${client.user.username}isim ile giriş yaptin!')
client.user.setStatus('online');
}).catch((err) => console.log(err));
 

Dosya Ekleri

  • 1701170968950.png
    30,9 KB · Görüntüleme: 46
Son düzenleme:
Kodunuzun farklı bir bölümünde aynı ifadeyi (client) kullandığınız için bu hatayı alıyorsunuz. Kod içerisinde arama yaparak nerede kullandığını görüp birini değiştirebilrisin.
 
Bu siteyi kullanmak için çerezler gereklidir. Siteyi kullanmaya devam etmek için çerezleri kabul etmelisiniz. Daha Fazlasını Öğren.…