Discord botunun oynuyor kısmına tarih ekleme

Bu kanalı izlemeni öneririm belki değinmiştir o noktaya.
Düzenleme: Hatta Discord sunucularına gidip sorabilirsin.

Bu içeriği görüntülemek için üçüncü taraf çerezlerini yerleştirmek için izninize ihtiyacımız olacak.
Daha detaylı bilgi için, çerezler sayfamıza bakınız.
 
JavaScript:
client.on("ready", () =>{
    console.log(`Logged in as ${client.user.tag}!`);
    client.user.setPresence({
        status: "online",  // You can show online, idle... Do not disturb is dnd
        game: {
            name: "!help",  // The message shown
            type: "PLAYING" // PLAYING, WATCHING, LISTENING, STREAMING,
        }
    });
 });

const activities_list = [
    "with the &help command.",
    "with the developers console",
    "with some code",
    "with JavaScript"
    ]; // creates an arraylist containing phrases you want your bot to switch through.

bot.on('ready', () => {
    setInterval(() => {
        const index = Math.floor(Math.random() * (activities_list.length - 1) + 1); // generates a random number between 1 and the length of the activities array list (in this case 5).
        bot.user.setActivity(activities_list[index]); // sets bot's activities to one of the phrases in the arraylist.
    }, 10000); // Runs this every 10 seconds.
});

Şuna benzer bir algoritma yapman gerekiyor.
 
Evet biliyorum uzun zaman geçti. Fakat zamanla öğreniliyor. Ilk başta ready.js dosyasında moment modülünü tanımlamamız gerekiyor. Moment tanımlamak için const moment = require('moment) kodunu tanımların arasına ekliyoruz. Daha sonra ise oynuyor kısmına moment().format('DD.MM.YYYY') ekliyoruz ve bitiyor. Iyi günler!
 

Geri
Yukarı