Created
March 20, 2025 16:31
-
-
Save KOULIKS94/b63f15788f5750be2478faeb0c043bd0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { bot } = require('../lib'); | |
| bot( | |
| { | |
| pattern: 'fight ?(.*)', | |
| desc: 'Challenge someone to an anime-style battle!', | |
| type: 'fun', | |
| onlyGroup: true, | |
| }, | |
| async (message, match) => { | |
| if (!match) return await message.send('⚔ *Usage:* !fight @opponent'); | |
| const opponent = match.replace('@', '').trim(); | |
| if (!opponent) return await message.send('❌ Please tag an opponent!'); | |
| const fighters = ["Naruto", "Luffy", "Goku", "Ichigo", "Gojo", "Eren", "Saitama", "Tanjiro", "Levi", "Rimuru"]; | |
| const attacks = ["Rasengan", "Kamehameha", "One Punch", "Bankai", "Hollow Mode", "Demon Slayer Slash", "Dragon Fist", "Infinity Void"]; | |
| // Assign fighters and attacks | |
| const player1 = fighters[Math.floor(Math.random() * fighters.length)]; | |
| const player2 = fighters[Math.floor(Math.random() * fighters.length)]; | |
| while (player1 === player2) player2 = fighters[Math.floor(Math.random() * fighters.length)]; | |
| const attack1 = attacks[Math.floor(Math.random() * attacks.length)]; | |
| const attack2 = attacks[Math.floor(Math.random() * attacks.length)]; | |
| // Decide the winner randomly | |
| const winner = Math.random() > 0.5 ? message.sender : opponent; | |
| const loser = winner === message.sender ? opponent : message.sender; | |
| await message.send( | |
| `⚔ *Anime Battle!* ⚔\n\n👊 *${player1}* ( @${message.sender.split('@')[0]} ) used *${attack1}*!\n🔥 *${player2}* ( @${opponent} ) countered with *${attack2}*!\n\n🏆 *Winner:* @${winner.split('@')[0]}!\n💀 *Loser:* @${loser.split('@')[0]}!\n\n🎉 Congrats to the champion!` | |
| ); | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment