buddy

node MVC discord bot
Log | Files | Refs | README

processing.js (1673B)


      1 
      2 const apiroute = require('./3party.js')
      3 const tool = require("./tools.js");
      4 
      5   const processingCommand = async(message) => {
      6 
      7       let fullCommand = message.content.substr(1)
      8       let splitCommand = fullCommand.split(" ")
      9       let primaryCommand = splitCommand[0]
     10       let arguements = splitCommand.slice(1)
     11 
     12       switch (primaryCommand) {
     13 
     14          case 'help':
     15                           tool.help(arguements, message)
     16                           break;
     17           case 'multiply':
     18                           tool.multiply(arguements, message)
     19                           break;
     20           case "iss":
     21                           message.channel.send(await apiroute.iss());
     22                           break;
     23           case "joke":
     24                           message.channel.send(await apiroute.joke());
     25                           break;
     26           case "code":
     27                           message.channel.send(await apiroute.code());
     28                           break;
     29           case "beer":
     30                           message.channel.send(await apiroute.beer());
     31                           break;
     32           case "foas":
     33                           message.channel.send(await apiroute.foas1());
     34                           break;
     35           case "stocks":
     36                           message.channel.send(await apiroute.stocks(arguements, message));
     37                           break;
     38           case "yt":
     39                           message.channel.send(await apiroute.ytresults(arguements, message));
     40                           break;
     41           default:
     42                           tool.help(arguements, message);
     43                           break;
     44       }
     45 
     46 }
     47 
     48 
     49 module.exports = {processingCommand}