Bütün kodları atar mısınız?
const Discord = require('discord.js');
const client = new Discord.Client();
const prefix = '!'; // İstediğiniz komut öneki
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (!msg.content.startsWith(prefix) || msg.author.bot) return;
const args = msg.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
if (command === 'zar') {
const number = Math.floor(Math.random() * 6) + 1;
msg.reply(`Atılan zar: ${number}`);
} else if (command === 'yaz') {
msg.channel.send(args.join(' '));
} else if (command === 'kaçcm') {
const height = Math.floor(Math.random() * 30 + 150);
msg.reply(`Boyun: ${height} cm`);
} else if (command === 'saka') {
const jokes = ['Neden iki delikli peynir tercih edilir? -Çünkü bir deliği daha azı daha deliğe düşürür.',
'Adamın biri denize düşmüş ne olmuş? -Islanmış.',
'Adamın biri gülmüş ne olmuş? -Dişler gözükülmüş.'];
const randomJoke = jokes[Math.floor(Math.random() * jokes.length)];
msg.reply(randomJoke);
} else if (command === 'rastgele') {
const randomNum = Math.floor(Math.random() * 100);
msg.reply(`Rastgele sayı: ${randomNum}`);
}
});
const kelimeListesi = ["elma", "armut", "çilek", "portakal"]; // kelime listesi
function adamAsmaca(kelime) {
// oyun kodu
}
client.on("message", (msg) => {
if (msg.content.startsWith("!adamasmaca")) {
const kelime = kelimeListesi[Math.floor(Math.random() * kelimeListesi.length)]; // rastgele kelime seç
adamAsmaca(kelime); // oyunu başlat
}
});
client.login('t'); // Discord Developer Portal'dan aldığınız bot tokeni