mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 06:42:51 +02:00
Minor Error Catching Modifications
This commit is contained in:
@@ -30,7 +30,7 @@ module.exports = class MathCommand extends Command {
|
|||||||
const expression = args.expression;
|
const expression = args.expression;
|
||||||
try {
|
try {
|
||||||
const solved = math.eval(expression);
|
const solved = math.eval(expression);
|
||||||
return message.say(solved).catch(err => message.say(':x: Error! Invalid statement!'));
|
return message.say(solved).catch(() => message.say(':x: Error! Invalid statement!'));
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
return message.say(':x: Error! Invalid statement!');
|
return message.say(':x: Error! Invalid statement!');
|
||||||
|
|||||||
@@ -26,6 +26,6 @@ module.exports = class CowsayCommand extends Command {
|
|||||||
text: turnToCowsay,
|
text: turnToCowsay,
|
||||||
e: 'oO',
|
e: 'oO',
|
||||||
T: 'U '
|
T: 'U '
|
||||||
})).catch(error => message.say(':x: Error! Perhaps the content is too long?'));
|
})).catch(() => message.say(':x: Error! Perhaps the content is too long?'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user