mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 21:40:49 +02:00
glass-shatter, ghost, tax Commands + Bug Fixes
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
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)}`);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user