Discord botumun shardını durumuna gösteremiyorum

Egemen.Gezer

Decapat
Katılım
5 Aralık 2020
Mesajlar
45
Yer
Kocaeli
Daha fazla  
Cinsiyet
Erkek
Meslek
Öğrenci
Öncelikle günaydın.
Ben yeni bir bot yaptım ve botuma shard ekledim. Shardın durumda gözükmesini istiyorum. İlk başta direk hata veriyordu bir kısmını çözdüm. Artık hata vermiyor ama bu sefer de nan diyor shardının yazması gereken yerde. Nasıl düzeltebilirim? Aşağıya ready.js in fotoğrafını bırakıyorum.

20210511_054043.jpg


20210511_054030.jpg
 
Son düzenleyen: Moderatör:
Stack Overflow'da böyle bir şey buldum bunu kendine göre ayarlayabilirsin. Ek olarak sanırım V11 de yazılmış V12'de değiştiyse onu da ayarlaman gerek.

JavaScript:
// For each shard, get the shard ID and the number of guilds it owns
let values = await client.shard.broadcastEval(`
    [
        this.shard.id,
        this.guilds.size
    ]
`);
// Make a final string which will be sent in the channel
let finalString = "**SHARD STATUS**\n\n";
// For each shard data
values.forEach((value) => {
    // Add the shard infos to the final string
    finalString += "• SHARD #"+value[0]+" | ServerCount: "+value[1]+"\n";
});
// Send the final string in the channel
message.channel.send(finalString);
 
Stack Overflow'da böyle bir şey buldum bunu kendine göre ayarlayabilirsin. Ek olarak sanırım V11 de yazılmış V12'de değiştiyse onu da ayarlaman gerek.

JavaScript:
// For each shard, get the shard ID and the number of guilds it owns.
let values = await client.shard.broadcastEval(`
 [
 this.shard.id,
 this.guilds.size
 ]
`);
// Make a final string which will be sent in the channel.
let finalString = "**SHARD STATUS**\n\n";
// For each shard data.
values.forEach((value) => {
 // Add the shard infos to the final string.
 finalString += "• SHARD #"+value[0]+" | ServerCount: "+value[1]+"\n";
});
// Send the final string in the channel.
message.channel.send(finalString);

İstediği şey bu değil. Bu komutta bütün shardları gösteriyor.
 

Geri
Yukarı