buddy

node MVC discord bot
Log | Files | Refs | README

tools.js (1460B)


      1 const multiply = async(arguements, message) =>{
      2   if (arguements.length < 2){
      3     message.channel.send('not enough arguements, you need 2')
      4   }else{
      5   let product = 1
      6   arguements.forEach((value)=>{
      7     product = product * parseFloat(value)
      8   })
      9   message.channel.send('the product of ' + arguements + 'is '+ product.toString())
     10    }
     11 }
     12 
     13 
     14 const help = async(arguements, message) =>{
     15         if (arguements.length == 0 ){
     16               message.channel.send(`
     17                   Here are some commands you can throw at me !<command>:
     18                           - !multiply[x y]
     19                           - !iss
     20                           - !code
     21                           - !beer
     22                           - !joke
     23 			              - !stocks [symbol]
     24 			              - !yt [topic]
     25                   `)
     26           }
     27         else{
     28               message.channel.send('looks like you need help with ' + arguements)
     29             }
     30 }
     31 
     32 // this needs work lol
     33 const time = function(){
     34         var date = new date()
     35         var hours = date.getHours()
     36         if (hours == 3){
     37               message.channel.send('Good morning Everyone!')
     38         }else if (hours == 12){
     39               message.channel.send("its Noon O'Clock")
     40         } else if(hours == 17){
     41               message.channel.send('Good Evening everyone!')
     42         }
     43 }
     44 
     45 const timer = async(arguements, message) =>{
     46   const length = arguements[0];
     47   setTimeout(length);
     48   
     49 
     50 }
     51 
     52 module.exports = {time, multiply, help}