mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 06:37:32 +02:00
Change arg assignment
This commit is contained in:
@@ -41,8 +41,7 @@ module.exports = class CurrencyCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { base, target, amount } = args;
|
||||
async run(msg, { base, target, amount }) {
|
||||
if (base === target) return msg.say(`Converting ${base} to ${target} is the same value, dummy.`);
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
|
||||
@@ -39,8 +39,7 @@ module.exports = class TemperatureCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, args) { // eslint-disable-line consistent-return
|
||||
const { base, target, amount } = args;
|
||||
run(msg, { base, target, amount }) { // eslint-disable-line consistent-return
|
||||
if (base === target) return msg.say(`Converting ${base} to ${target} is the same value, dummy.`);
|
||||
if (base === 'celsius') {
|
||||
if (target === 'fahrenheit') return msg.say(`${amount}°C is ${(amount * 1.8) + 32}°F.`);
|
||||
|
||||
Reference in New Issue
Block a user