김대연

ejs hotfix

1 -const tmi = require('tmi.js'); 1 +// const tmi = require('tmi.js');
2 -const papago = require('./openAPIs/papago_api') 2 +// const papago = require('./openAPIs/papago_api')
3 -const ttlserver = require('../socket_server') 3 +// const ttlserver = require('../socket_server')
4 - 4 +
5 -// Define configuration options 5 +// // Define configuration options
6 -var opts = { 6 +// var opts = {
7 - identity: { 7 +// identity: {
8 - username: process.env.BOT_USERNAME, 8 +// username: process.env.BOT_USERNAME,
9 - password: process.env.OAUTH_TOKEN 9 +// password: process.env.OAUTH_TOKEN
10 - }, 10 +// },
11 - channels: [ 11 +// channels: [
12 - 'bachelorchuckchuck' 12 +// 'bachelorchuckchuck'
13 - ] 13 +// ]
14 -}; 14 +// };
15 - 15 +
16 -// Create a client with our options 16 +// // Create a client with our options
17 -const client = new tmi.client(opts); 17 +// const client = new tmi.client(opts);
18 - 18 +
19 -// Register our event handlers (defined below) 19 +// // Register our event handlers (defined below)
20 -client.on('message', onMessageHandler); 20 +// client.on('message', onMessageHandler);
21 -client.on('connected', onConnectedHandler); 21 +// client.on('connected', onConnectedHandler);
22 - 22 +
23 -// Connect to Twitch: 23 +// // Connect to Twitch:
24 -client.connect(); 24 +// client.connect();
25 - 25 +
26 -// Called every time a message comes in 26 +// // Called every time a message comes in
27 -function onMessageHandler (target, context, msg, self) { 27 +// function onMessageHandler (target, context, msg, self) {
28 - if (self) { return; } // Ignore messages from the bot 28 +// if (self) { return; } // Ignore messages from the bot
29 - 29 +
30 - client.say(target, `/color `+changecolor()); 30 +// client.say(target, `/color `+changecolor());
31 - papago.detectchat(msg, client, target); 31 +// papago.detectchat(msg, client, target);
32 - 32 +
33 - if(msg == '척척학사'){ 33 +// if(msg == '척척학사'){
34 - client.say(target, `안녕하세요 척척학사의 방송입니다.`); 34 +// client.say(target, `안녕하세요 척척학사의 방송입니다.`);
35 - } 35 +// }
36 - 36 +
37 -} 37 +// }
38 - 38 +
39 -exports.addChannel = (channel) =>{ 39 +// exports.addChannel = (channel) =>{
40 - opts.channels.append(channel); 40 +// opts.channels.append(channel);
41 -} 41 +// }
42 - 42 +
43 -// Called every time the bot connects to Twitch chat 43 +// // Called every time the bot connects to Twitch chat
44 -function onConnectedHandler (addr, port) { 44 +// function onConnectedHandler (addr, port) {
45 - console.log(`* Connected to ${addr}:${port}`); 45 +// console.log(`* Connected to ${addr}:${port}`);
46 -} 46 +// }
......
...@@ -3,7 +3,8 @@ const config = require('./config/config') ...@@ -3,7 +3,8 @@ const config = require('./config/config')
3 const app = require('express')(); 3 const app = require('express')();
4 const http = require('http').Server(app); 4 const http = require('http').Server(app);
5 const io = require('socket.io')(http); 5 const io = require('socket.io')(http);
6 -const papago = require('./openAPIs/papago_api') 6 +const papago = require('./openAPIs/papago_api');
7 +
7 // const tmi = require('tmi.js'); 8 // const tmi = require('tmi.js');
8 // // Define configuration options 9 // // Define configuration options
9 // var opts = { 10 // var opts = {
...@@ -19,12 +20,13 @@ const papago = require('./openAPIs/papago_api') ...@@ -19,12 +20,13 @@ const papago = require('./openAPIs/papago_api')
19 // const client = new tmi.client(opts); //twitch chatbot client 20 // const client = new tmi.client(opts); //twitch chatbot client
20 21
21 app.set('view engine', 'ejs'); 22 app.set('view engine', 'ejs');
22 -app.set('views', './testviews'); 23 +app.set('views', './server/testviews');
23 24
24 let room = ['streamer1', 'streamer2']; 25 let room = ['streamer1', 'streamer2'];
25 // client.opts.channels; 26 // client.opts.channels;
26 let a = 0; 27 let a = 0;
27 28
29 +
28 app.get('/', (req, res) => { 30 app.get('/', (req, res) => {
29 res.render('chat'); 31 res.render('chat');
30 }); 32 });
......