const Discord = require('discord.js');
const { ChannelProcessor } = require('./channelProcessor');
const {discordApiToken } = require('./secrets.js');
const client = new Discord.Client();

const channelProcessorMap = {};

client.on('ready', () => {
  console.log('Bot is ready');
});

client.on('message', (message) => {
  const channel = message.channel;
  const channelID = message.channel.id;

  if(channelProcessorMap[channelID] == null) {
    const newChannelProcessor =  new ChannelProcessor(channelID);
    newChannelProcessor.setOnHaikuFunction((haiku) => {
      channel.send(
      `${haiku.author} has created a beautiful Haiku!
      ${haiku.lines[0]}
      ${haiku.lines[1]}
      ${haiku.lines[2]}`);
    });
    channelProcessorMap[channelID] = newChannelProcessor;
  }

  channelProcessorMap[channelID].processMessage(message);
});

client.login(discordApiToken);

@@ -559,16 +559,126 @@
 u) =%3E %7B%0A
+      console.log(%0A        %60Haiku triggered:%0A        author: $%7Bhaiku.author%7D%0A        lines: $%7Bhaiku.lines%7D%60);%0A
       ch
@@ -695,16 +695,18 @@
 (%0A      
+ 
+ 
 %60$%7Bhaiku
@@ -747,24 +747,26 @@
 aiku!%0A      
+  
 $%7Bhaiku.line
@@ -771,16 +771,18 @@
 nes%5B0%5D%7D%0A
+  
       $%7B
@@ -797,16 +797,18 @@
 nes%5B1%5D%7D%0A
+  
       $%7B

Add console logging upon haiku trigger