buddy

node MVC discord bot
Log | Files | Refs | README

message.js (1197B)


      1 
      2 const discord = require('discord.js');
      3 const client = new discord.Client();
      4 const fetch = require('node-fetch');
      5 var config = require('../config/config.js');
      6 var apiroute = require('../lib/3party.js')
      7 
      8 
      9 const internalResponse = async(client) => {
     10 
     11       await client.on('message', (message) => {
     12             const process = require("../lib/processing.js");
     13 
     14             if (message.author == client.user){
     15               return
     16             }
     17             //message.channel.send("message received, " + message.author.toString() + ": " + message.content)
     18             if (message.content == 'hi buddy'){
     19                 message.react("🤚")
     20                 message.channel.send('whats good ' + message.author)
     21             }else if(message.content.includes('buddy')){
     22                 message.channel.send('hi');
     23             }else if(message.content.includes('buddy' && 'fuck')){
     24                 message.channel.send('aahhhh my virgin ears!')
     25             }
     26 
     27             if(message.content.startsWith("!")){
     28                 console.log('hit the starts with ! if statement');
     29                 process.processingCommand(message);
     30               }
     31 
     32             })
     33 
     34 }
     35 
     36 module.exports = {
     37   internalResponse
     38 }