mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
35 lines
903 B
JavaScript
35 lines
903 B
JavaScript
const Command = require('../../framework/Command');
|
|
const { randomRange } = require('../../util/Util');
|
|
const fishes = require('../../assets/json/fishy');
|
|
|
|
module.exports = class FishyCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'fishy',
|
|
aliases: ['fishing', 'fish'],
|
|
group: 'games-sp',
|
|
memberName: 'fishy',
|
|
description: 'Go fishing.',
|
|
credit: [
|
|
{
|
|
name: 'Tatsumaki',
|
|
url: 'https://tatsumaki.xyz/',
|
|
reason: 'Concept'
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg) {
|
|
const fishID = Math.floor(Math.random() * 10) + 1;
|
|
let rarity;
|
|
if (fishID < 5) rarity = 'junk';
|
|
else if (fishID < 8) rarity = 'common';
|
|
else if (fishID < 10) rarity = 'uncommon';
|
|
else rarity = 'rare';
|
|
const fish = fishes[rarity];
|
|
const worth = randomRange(fish.min, fish.max);
|
|
return msg.reply(`You caught a ${fish.symbol}. I bet it'd sell for around $${worth}.`);
|
|
}
|
|
};
|