- Katılım
- 9 Ara 2020
- Konular
- 71
- Mesajlar
- 255
- Çözümler
- 1
- Tepki puanı
- 218
- Puanları
- 2,110
Herkese merhaba bugün sizlerle matematik işlem komutunu paylaşacağım bu komutu yazınca bot bize bir işlem veriyor biz de işlemin sonucunu bulmaya çalışıyoruz ve 3 tane zorluğu var bunu komutun yanına yazıyoruz.
Kod ;
Görseller ;
Kod ;
JavaScript:
if(text.toLowerCase()=="kolay")
{
var tsüre = 3000
var işlem = sayiliste[Math.floor(Math.random()*10)]+"+"+sayiliste[Math.floor(Math.random()*10)];
} if(text.toLowerCase()=="orta")
{
var tsüre = 7000
var işlem = sayiliste[Math.floor(Math.random()*10)]+sayiliste[Math.floor(Math.random()*10)]+"+"+sayiliste[Math.floor(Math.random()*10)]+sayiliste[Math.floor(Math.random()*10)];
} if(text.toLowerCase()=="zor")
{
var tsüre=10000;
var işlem = sayiliste[Math.floor(Math.random()*10)]+sayiliste[Math.floor(Math.random()*10)]+sayiliste[Math.floor(Math.random()*10)]+"+"+sayiliste[Math.floor(Math.random()*10)]+sayiliste[Math.floor(Math.random()*10)]+sayiliste[Math.floor(Math.random()*10)];
} else return message.channel.send("Lütfen zorluk yazınız(kolay,orta,zor) | Örnek : ``"+prefix+"işlemoyunu kolay``")
var k = 0,kk=0;
var filter = m => m.author.id === message.author.id;
setTimeout(function(){
if(k==0){
message.channel.send("Süre bitti!");
kk++;
}
},tsüre)
message.channel.send(new Discord.MessageEmbed().setTitle("İşlem sorusu : "+işlem).setColor("RANDOM")).then(message=>{
message.channel.awaitMessages(filter,{
max:1
}).then(collected=>{
if(kk==0){
if(collected.first().content==eval(işlem)){
message.channel.send(new Discord.MessageEmbed().setTitle("Doğru cevap").setColor("GREEN"))
k++;
}else{
message.channel.send(new Discord.MessageEmbed().setTitle("Yanlış cevap").setColor("RED"))
k++;
}
}
})
})
Görseller ;