kedy

.gg/amongusturkiye
Yönetici
kedy0
Katılım
14 Eyl 2021
Mesajlar
379
Tepkime puanı
322
Şehir
İstanbul
Selam millet! Bugün sizlere düello komutu vereceğim.
Komutlara atılacak :

JavaScript:
const Discord = require('discord.js');
const { stripIndents } = require('common-tags');
const { randomRange, verify } = require('../util/Util.js');
exports.run = async (client, message, args) => {
      if (!message.guild) {
    const ozelmesajuyari = new Discord.MessageEmbed()
    .setColor(0xFF0000)
    .setTimestamp()
    .setAuthor(message.author.username, message.author.avatarURL)
    .addField('**Komutları Özel Mesajlarda Kullanılamaz!**')
    return message.author.send(ozelmesajuyari); }
  this.fighting = new Set();
 
    let opponent = message.mentions.users.first()
    if (!opponent) return message.reply("Oynamak istediğin kişiyi etiketlemelisin!")
 
  if (opponent.bot) return message.reply('Botlar ile oynayamazsın!');
  if (opponent.id === message.author.id) return message.reply('Kendin ile düello Atamazsın');
        if (this.fighting.has(message.channel.id)) return message.reply('Kanal başına sadece bir düello meydana gelebilir.');
        this.fighting.add(message.channel.id);
        try {
            if (!opponent.bot) {
                await message.channel.send(`${opponent}, düello isteği geldi. Düello'yu kabul ediyor musun? (\`evet\` veya \`hayir\` olarak cevap veriniz.)`);
                const verification = await verify(message.channel, opponent);
                if (!verification) {
                    this.fighting.delete(message.channel.id);
                    return message.channel.send(`Düello kabul edilmedi...`);
                }
            }
            let userHP = 500;
            let oppoHP = 500;
            let userTurn = false;
            let guard = false;
            const reset = (changeGuard = true) => {
                userTurn = !userTurn;
                if (changeGuard && guard) guard = false;
            };
            const dealDamage = damage => {
                if (userTurn) oppoHP -= damage;
                else userHP -= damage;
            };
            const forfeit = () => {
                if (userTurn) userHP = 0;
                else oppoHP = 0;
            };
            while (userHP > 0 && oppoHP > 0) { // eslint-disable-line no-unmodified-loop-condition
                const user = userTurn ? message.author : opponent;
                let choice;
                if (!opponent.bot || (opponent.bot && userTurn)) {
                    await message.channel.send(stripIndents`
                        ${user}, ne yapmak istersin? \`saldır\`, \`savun\`, \`ultra güç\`, veya \`kaç\`?
                        **${message.author.username}**: ${userHP} :heartpulse:
                        **${opponent.username}**: ${oppoHP} :heartpulse:
                    `);
                    const filter = res =>
                        res.author.id === user.id && ['saldır', 'savun', 'ultra güç', 'kaç'].includes(res.content.toLowerCase());
                    const turn = await message.channel.awaitMessages(filter, {
                        max: 1,
                        time: 30000
                    });
                    if (!turn.size) {
                        await message.reply(`Üzgünüm ama, süre doldu!`);
                        reset();
                        continue;
                    }
                    choice = turn.first().content.toLowerCase();
                } else {
                    const choices = ['saldır', 'savun', 'ultra güç'];
                    choice = choices[Math.floor(Math.random() * choices.length)];
                }
                if (choice === 'saldır') {
                    const damage = Math.floor(Math.random() * (guard ? 10 : 100)) + 1;
                    await message.channel.send(`${user}, **${damage}** hasar vurdu!`);
                    dealDamage(damage);
                    reset();
                } else if (choice === 'savun') {
                    await message.channel.send(`${user}, kendisini süper kalkan ile savundu!`);
                    guard = true;
                    reset(false);
                } else if (choice === 'ultra güç') {
                    const miss = Math.floor(Math.random() * 4);
                    if (!miss) {
                        const damage = randomRange(100, guard ? 150 : 300);
                        await message.channel.send(`${user}, Çoook uzak galaksilerden gelen ultra sonik enerjiyi yeterki miktarda topladın ve **${damage}** hasar vurdun!!`);
                        dealDamage(damage);
                    } else {
                        await message.channel.send(`${user}, Çoook uzak galaksilerden gelen ultra sonik enerjiyi yeterli miktarda toplayamadığın için ulta güç kullanamadın!`);
                    }
                    reset();
                } else if (choice === 'kaç') {
                    await message.channel.send(`${user}, kaçtı! Korkak!`);
                    forfeit();
                    break;
                } else {
                    await message.reply('Ne yapmak istediğini anlamadım.');
                }
            }
            this.fighting.delete(message.channel.id);
            const winner = userHP > oppoHP ? message.author : opponent;
            return message.channel.send(`Oyun bitti! Tebrikler, **${winner}** kazandı! \n**${message.author.username}**: ${userHP} :heartpulse: \n**${opponent.username}**: ${oppoHP} :heartpulse:`);
        } catch (err) {
            this.fighting.delete(message.channel.id);
            throw err;
        }
  }
exports.conf = {
  enabled: true,
  guildOnly: false,
  aliases: ['1vs1', '1v1', 'savaş','düello'],
  permLevel: 0
};
exports.help = {
  name: 'duello',
  category: "eğlence",
  description: 'İstediğiniz bir kişi ile düello atarsınız!',
  usage: 'duello <@kullanıcı>'
};
 
  • Beğen
Tepkiler: kaanshu

kaanshu

Bu kullanıcı dolandırıcılık sebebiyle yasaklanmış, ticaret yapmayın!
Dolandırıcı
kaanshu#1337
Katılım
8 Eyl 2021
Mesajlar
136
Tepkime puanı
297
Selam millet! Bugün sizlere düello komutu vereceğim.
Komutlara atılacak :

JavaScript:
const Discord = require('discord.js');
const { stripIndents } = require('common-tags');
const { randomRange, verify } = require('../util/Util.js');
exports.run = async (client, message, args) => {
      if (!message.guild) {
    const ozelmesajuyari = new Discord.MessageEmbed()
    .setColor(0xFF0000)
    .setTimestamp()
    .setAuthor(message.author.username, message.author.avatarURL)
    .addField('**Komutları Özel Mesajlarda Kullanılamaz!**')
    return message.author.send(ozelmesajuyari); }
  this.fighting = new Set();

    let opponent = message.mentions.users.first()
    if (!opponent) return message.reply("Oynamak istediğin kişiyi etiketlemelisin!")

  if (opponent.bot) return message.reply('Botlar ile oynayamazsın!');
  if (opponent.id === message.author.id) return message.reply('Kendin ile düello Atamazsın');
        if (this.fighting.has(message.channel.id)) return message.reply('Kanal başına sadece bir düello meydana gelebilir.');
        this.fighting.add(message.channel.id);
        try {
            if (!opponent.bot) {
                await message.channel.send(`${opponent}, düello isteği geldi. Düello'yu kabul ediyor musun? (\`evet\` veya \`hayir\` olarak cevap veriniz.)`);
                const verification = await verify(message.channel, opponent);
                if (!verification) {
                    this.fighting.delete(message.channel.id);
                    return message.channel.send(`Düello kabul edilmedi...`);
                }
            }
            let userHP = 500;
            let oppoHP = 500;
            let userTurn = false;
            let guard = false;
            const reset = (changeGuard = true) => {
                userTurn = !userTurn;
                if (changeGuard && guard) guard = false;
            };
            const dealDamage = damage => {
                if (userTurn) oppoHP -= damage;
                else userHP -= damage;
            };
            const forfeit = () => {
                if (userTurn) userHP = 0;
                else oppoHP = 0;
            };
            while (userHP > 0 && oppoHP > 0) { // eslint-disable-line no-unmodified-loop-condition
                const user = userTurn ? message.author : opponent;
                let choice;
                if (!opponent.bot || (opponent.bot && userTurn)) {
                    await message.channel.send(stripIndents`
                        ${user}, ne yapmak istersin? \`saldır\`, \`savun\`, \`ultra güç\`, veya \`kaç\`?
                        **${message.author.username}**: ${userHP} :heartpulse:
                        **${opponent.username}**: ${oppoHP} :heartpulse:
                    `);
                    const filter = res =>
                        res.author.id === user.id && ['saldır', 'savun', 'ultra güç', 'kaç'].includes(res.content.toLowerCase());
                    const turn = await message.channel.awaitMessages(filter, {
                        max: 1,
                        time: 30000
                    });
                    if (!turn.size) {
                        await message.reply(`Üzgünüm ama, süre doldu!`);
                        reset();
                        continue;
                    }
                    choice = turn.first().content.toLowerCase();
                } else {
                    const choices = ['saldır', 'savun', 'ultra güç'];
                    choice = choices[Math.floor(Math.random() * choices.length)];
                }
                if (choice === 'saldır') {
                    const damage = Math.floor(Math.random() * (guard ? 10 : 100)) + 1;
                    await message.channel.send(`${user}, **${damage}** hasar vurdu!`);
                    dealDamage(damage);
                    reset();
                } else if (choice === 'savun') {
                    await message.channel.send(`${user}, kendisini süper kalkan ile savundu!`);
                    guard = true;
                    reset(false);
                } else if (choice === 'ultra güç') {
                    const miss = Math.floor(Math.random() * 4);
                    if (!miss) {
                        const damage = randomRange(100, guard ? 150 : 300);
                        await message.channel.send(`${user}, Çoook uzak galaksilerden gelen ultra sonik enerjiyi yeterki miktarda topladın ve **${damage}** hasar vurdun!!`);
                        dealDamage(damage);
                    } else {
                        await message.channel.send(`${user}, Çoook uzak galaksilerden gelen ultra sonik enerjiyi yeterli miktarda toplayamadığın için ulta güç kullanamadın!`);
                    }
                    reset();
                } else if (choice === 'kaç') {
                    await message.channel.send(`${user}, kaçtı! Korkak!`);
                    forfeit();
                    break;
                } else {
                    await message.reply('Ne yapmak istediğini anlamadım.');
                }
            }
            this.fighting.delete(message.channel.id);
            const winner = userHP > oppoHP ? message.author : opponent;
            return message.channel.send(`Oyun bitti! Tebrikler, **${winner}** kazandı! \n**${message.author.username}**: ${userHP} :heartpulse: \n**${opponent.username}**: ${oppoHP} :heartpulse:`);
        } catch (err) {
            this.fighting.delete(message.channel.id);
            throw err;
        }
  }
exports.conf = {
  enabled: true,
  guildOnly: false,
  aliases: ['1vs1', '1v1', 'savaş','düello'],
  permLevel: 0
};
exports.help = {
  name: 'duello',
  category: "eğlence",
  description: 'İstediğiniz bir kişi ile düello atarsınız!',
  usage: 'duello <@kullanıcı>'
};
teşekkürler
 
  • Beğen
Tepkiler: Yasar ve kedy

Sowwyz

Bu kullanıcı dolandırıcılık sebebiyle yasaklanmış, ticaret yapmayın!
Dolandırıcı
'Sowwyz#8634
Katılım
19 Eyl 2021
Mesajlar
185
Tepkime puanı
75
Geliştirilerek kullanılabilir, eline sağlık
 
  • Beğen
Tepkiler: kedy
wolrock#9048
Katılım
6 Haz 2022
Mesajlar
3
Tepkime puanı
0
Şehir
Bitlis
Selam millet! Bugün sizlere düello komutu vereceğim.
Komutlara atılacak :

JavaScript:
const Discord = require('discord.js');
const { stripIndents } = require('common-tags');
const { randomRange, verify } = require('../util/Util.js');
exports.run = async (client, message, args) => {
      if (!message.guild) {
    const ozelmesajuyari = new Discord.MessageEmbed()
    .setColor(0xFF0000)
    .setTimestamp()
    .setAuthor(message.author.username, message.author.avatarURL)
    .addField('**Komutları Özel Mesajlarda Kullanılamaz!**')
    return message.author.send(ozelmesajuyari); }
  this.fighting = new Set();

    let opponent = message.mentions.users.first()
    if (!opponent) return message.reply("Oynamak istediğin kişiyi etiketlemelisin!")

  if (opponent.bot) return message.reply('Botlar ile oynayamazsın!');
  if (opponent.id === message.author.id) return message.reply('Kendin ile düello Atamazsın');
        if (this.fighting.has(message.channel.id)) return message.reply('Kanal başına sadece bir düello meydana gelebilir.');
        this.fighting.add(message.channel.id);
        try {
            if (!opponent.bot) {
                await message.channel.send(`${opponent}, düello isteği geldi. Düello'yu kabul ediyor musun? (\`evet\` veya \`hayir\` olarak cevap veriniz.)`);
                const verification = await verify(message.channel, opponent);
                if (!verification) {
                    this.fighting.delete(message.channel.id);
                    return message.channel.send(`Düello kabul edilmedi...`);
                }
            }
            let userHP = 500;
            let oppoHP = 500;
            let userTurn = false;
            let guard = false;
            const reset = (changeGuard = true) => {
                userTurn = !userTurn;
                if (changeGuard && guard) guard = false;
            };
            const dealDamage = damage => {
                if (userTurn) oppoHP -= damage;
                else userHP -= damage;
            };
            const forfeit = () => {
                if (userTurn) userHP = 0;
                else oppoHP = 0;
            };
            while (userHP > 0 && oppoHP > 0) { // eslint-disable-line no-unmodified-loop-condition
                const user = userTurn ? message.author : opponent;
                let choice;
                if (!opponent.bot || (opponent.bot && userTurn)) {
                    await message.channel.send(stripIndents`
                        ${user}, ne yapmak istersin? \`saldır\`, \`savun\`, \`ultra güç\`, veya \`kaç\`?
                        **${message.author.username}**: ${userHP} :heartpulse:
                        **${opponent.username}**: ${oppoHP} :heartpulse:
                    `);
                    const filter = res =>
                        res.author.id === user.id && ['saldır', 'savun', 'ultra güç', 'kaç'].includes(res.content.toLowerCase());
                    const turn = await message.channel.awaitMessages(filter, {
                        max: 1,
                        time: 30000
                    });
                    if (!turn.size) {
                        await message.reply(`Üzgünüm ama, süre doldu!`);
                        reset();
                        continue;
                    }
                    choice = turn.first().content.toLowerCase();
                } else {
                    const choices = ['saldır', 'savun', 'ultra güç'];
                    choice = choices[Math.floor(Math.random() * choices.length)];
                }
                if (choice === 'saldır') {
                    const damage = Math.floor(Math.random() * (guard ? 10 : 100)) + 1;
                    await message.channel.send(`${user}, **${damage}** hasar vurdu!`);
                    dealDamage(damage);
                    reset();
                } else if (choice === 'savun') {
                    await message.channel.send(`${user}, kendisini süper kalkan ile savundu!`);
                    guard = true;
                    reset(false);
                } else if (choice === 'ultra güç') {
                    const miss = Math.floor(Math.random() * 4);
                    if (!miss) {
                        const damage = randomRange(100, guard ? 150 : 300);
                        await message.channel.send(`${user}, Çoook uzak galaksilerden gelen ultra sonik enerjiyi yeterki miktarda topladın ve **${damage}** hasar vurdun!!`);
                        dealDamage(damage);
                    } else {
                        await message.channel.send(`${user}, Çoook uzak galaksilerden gelen ultra sonik enerjiyi yeterli miktarda toplayamadığın için ulta güç kullanamadın!`);
                    }
                    reset();
                } else if (choice === 'kaç') {
                    await message.channel.send(`${user}, kaçtı! Korkak!`);
                    forfeit();
                    break;
                } else {
                    await message.reply('Ne yapmak istediğini anlamadım.');
                }
            }
            this.fighting.delete(message.channel.id);
            const winner = userHP > oppoHP ? message.author : opponent;
            return message.channel.send(`Oyun bitti! Tebrikler, **${winner}** kazandı! \n**${message.author.username}**: ${userHP} :heartpulse: \n**${opponent.username}**: ${oppoHP} :heartpulse:`);
        } catch (err) {
            this.fighting.delete(message.channel.id);
            throw err;
        }
  }
exports.conf = {
  enabled: true,
  guildOnly: false,
  aliases: ['1vs1', '1v1', 'savaş','düello'],
  permLevel: 0
};
exports.help = {
  name: 'duello',
  category: "eğlence",
  description: 'İstediğiniz bir kişi ile düello atarsınız!',
  usage: 'duello <@kullanıcı>'
};
bu komutun v13 olanını yaparsanız daha güzel olabilir
 

Konuyu 1 kişi okuyor. (0 kayıtlı üye ve 1 ziyaretçi)

  • Bilgi