Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. case 'math':
  2.                 if (!args[1] || isNaN(args[1]) || !args[2] || !args[3] || isNaN(args[3])) {
  3.                     const embed = new Discord.RichEmbed()
  4.                         .setTitle("Error")
  5.                         .setDescription(PREFIX + "math {+ (add),x (multiply),- (subtract),/ (divide),% (remainder)}")
  6.                         .setColor(0xFF0000)
  7.                         .setFooter("Requested by " + message.author.username, message.author.avatarURL);
  8.                     message.channel.send(embed);
  9.                 } else if (args[2] == "+") {
  10.                     var Sum = +args[1] + +args[3];
  11.                     message.channel.send('The sum of ' + args[1] + ' + ' + args[3] + ' is ' + Sum + '.');
  12.                 } else if (args[2] == "x") {
  13.                     var Product = args[1] * args[3]
  14.                     message.channel.send('The product of ' + args[1] + ' x ' + args[3] + ' is ' + Product + '.');
  15.                 } else if (args[2] == "-") {
  16.                     var Difference = args[1] - args[3]
  17.                     message.channel.send('The difference of ' + args[1] + ' - ' + args[3] + ' is ' + Difference + '.');
  18.                 } else if (args[2] == "/") {
  19.                     var Quotient = args[1] / args[3]
  20.                     message.channel.send('The quotient of ' + args[1] + ' / ' + args[3] + ' is ' + Quotient + '.');
  21.                 } else if (args[2] == "%") {
  22.                     var Remainder = args[1] % args[3]
  23.                     message.channel.send('The remainder of ' + args[1] + ' % ' + args[3] + ' is ' + Remainder + '.');
  24.                 } else {const embed = new Discord.RichEmbed()
  25.                     .setTitle("Error")
  26.                     .setDescription(PREFIX + "math {+ (add),x (multiply),- (subtract),/ (divide),% (remainder)}")
  27.                     .setColor(0xFF0000)
  28.                     .setFooter("Requested by " + message.author.username, message.author.avatarURL);
  29.                 message.channel.send(embed);
  30.                 }
  31.                 break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement