mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 07:46:43 +02:00
33 lines
723 B
JavaScript
33 lines
723 B
JavaScript
const Command = require('../../structures/Command');
|
|
const { formatNumber } = require('../../util/Util');
|
|
|
|
module.exports = class TaxCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'tax',
|
|
group: 'edit-number',
|
|
memberName: 'tax',
|
|
description: 'Determines the total cost of something plus tax.',
|
|
args: [
|
|
{
|
|
key: 'rate',
|
|
prompt: 'What is the tax rate (in %)?',
|
|
type: 'integer',
|
|
max: 100,
|
|
min: 0
|
|
},
|
|
{
|
|
key: 'amount',
|
|
prompt: 'How much money should be converted?',
|
|
type: 'float'
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg, { rate, amount }) {
|
|
const result = amount + ((rate / 100) * amount);
|
|
return msg.reply(`$${formatNumber(result, 2)}`);
|
|
}
|
|
};
|