Change arg assignment

This commit is contained in:
Daniel Odendahl Jr
2017-09-16 01:44:44 +00:00
parent a4f290f50d
commit 1c9ac56831
135 changed files with 166 additions and 273 deletions
+1 -2
View File
@@ -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
+1 -2
View File
@@ -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.`);