mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 13:53:12 +02:00
More fun fishy command
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"junk": {
|
||||
"symbol": "🔧",
|
||||
"max": 5,
|
||||
"min": 0
|
||||
},
|
||||
"common": {
|
||||
"symbol": "🐟",
|
||||
"max": 50,
|
||||
"min": 10
|
||||
},
|
||||
"uncommon": {
|
||||
"symbol": "🐠",
|
||||
"max": 200,
|
||||
"min": 100
|
||||
},
|
||||
"rare": {
|
||||
"symbol": "🐡",
|
||||
"max": 500,
|
||||
"min": 300
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const fishes = ['🐟', '🐠', '🐡', '🔧'];
|
||||
const fishes = require('../../assets/json/fishy');
|
||||
|
||||
module.exports = class FishyCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -13,8 +13,13 @@ module.exports = class FishyCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const fish = fishes[Math.floor(Math.random() * fishes.length)];
|
||||
if (fish === '🔧') return msg.say(`You caught a ${fish}... Too bad...`);
|
||||
return msg.say(`You caught a ${fish}!`);
|
||||
const fish = Math.floor(Math.random() * 10) + 1;
|
||||
let rarity;
|
||||
if (fish < 5) rarity = 'junk';
|
||||
else if (fish < 8) rarity = 'common';
|
||||
else if (fish < 10) rarity = 'uncommon';
|
||||
else rarity = 'rare';
|
||||
const worth = Math.floor(Math.random() * (fishes[rarity].max - fishes[rarity].min + 1)) + fishes[rarity].min;
|
||||
return msg.say(`You caught a ${fishes[rarity].symbol}. I bet it'd sell for around $${worth}.`);
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "41.0.1",
|
||||
"version": "41.0.2",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user