Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 'math':
- if (!args[1] || isNaN(args[1]) || !args[2] || !args[3] || isNaN(args[3])) {
- const embed = new Discord.RichEmbed()
- .setTitle("Error")
- .setDescription(PREFIX + "math {+ (add),x (multiply),- (subtract),/ (divide),% (remainder)}")
- .setColor(0xFF0000)
- .setFooter("Requested by " + message.author.username, message.author.avatarURL);
- message.channel.send(embed);
- } else if (args[2] == "+") {
- var Sum = +args[1] + +args[3];
- message.channel.send('The sum of ' + args[1] + ' + ' + args[3] + ' is ' + Sum + '.');
- } else if (args[2] == "x") {
- var Product = args[1] * args[3]
- message.channel.send('The product of ' + args[1] + ' x ' + args[3] + ' is ' + Product + '.');
- } else if (args[2] == "-") {
- var Difference = args[1] - args[3]
- message.channel.send('The difference of ' + args[1] + ' - ' + args[3] + ' is ' + Difference + '.');
- } else if (args[2] == "/") {
- var Quotient = args[1] / args[3]
- message.channel.send('The quotient of ' + args[1] + ' / ' + args[3] + ' is ' + Quotient + '.');
- } else if (args[2] == "%") {
- var Remainder = args[1] % args[3]
- message.channel.send('The remainder of ' + args[1] + ' % ' + args[3] + ' is ' + Remainder + '.');
- } else {const embed = new Discord.RichEmbed()
- .setTitle("Error")
- .setDescription(PREFIX + "math {+ (add),x (multiply),- (subtract),/ (divide),% (remainder)}")
- .setColor(0xFF0000)
- .setFooter("Requested by " + message.author.username, message.author.avatarURL);
- message.channel.send(embed);
- }
- break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement