김대연

change README.md

...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
9 9
10 ## 실행방법 10 ## 실행방법
11 11
12 +>.env파일을 만듭니다.
13 +
12 ``` 14 ```
13 cd server 15 cd server
14 npm install pkg.json --save 16 npm install pkg.json --save
......
...@@ -4,19 +4,19 @@ const app = require('express')(); ...@@ -4,19 +4,19 @@ 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 -const tmi = require('tmi.js'); 7 +// const tmi = require('tmi.js');
8 -// Define configuration options 8 +// // Define configuration options
9 -var opts = { 9 +// var opts = {
10 - identity: { 10 +// identity: {
11 - username: process.env.BOT_USERNAME, 11 +// username: process.env.BOT_USERNAME,
12 - password: process.env.OAUTH_TOKEN 12 +// password: process.env.OAUTH_TOKEN
13 - }, 13 +// },
14 - channels: [ 14 +// channels: [
15 - 'bachelorchuckchuck' 15 +// 'bachelorchuckchuck'
16 - ] 16 +// ]
17 - }; 17 +// };
18 -// Create a client with our options 18 +// // Create a client with our options
19 -const client = new tmi.client(opts); //twitch chatbot client 19 +// const client = new tmi.client(opts); //twitch chatbot client
20 20
21 app.set('view engine', 'ejs'); 21 app.set('view engine', 'ejs');
22 app.set('views', './testviews'); 22 app.set('views', './testviews');
...@@ -71,28 +71,28 @@ http.listen(process.env.SOCKET_PORT, () => { ...@@ -71,28 +71,28 @@ http.listen(process.env.SOCKET_PORT, () => {
71 /////////////////////Twitch Bot////////////////////////// 71 /////////////////////Twitch Bot//////////////////////////
72 72
73 73
74 -// Register our event handlers (defined below) 74 +// // Register our event handlers (defined below)
75 -client.on('message', onMessageHandler); 75 +// client.on('message', onMessageHandler);
76 -client.on('connected', onConnectedHandler); 76 +// client.on('connected', onConnectedHandler);
77 77
78 -// Connect to Twitch: 78 +// // Connect to Twitch:
79 -client.connect(); 79 +// client.connect();
80 80
81 -// Called every time a message comes in 81 +// // Called every time a message comes in
82 -function onMessageHandler (target, context, msg, self) { 82 +// function onMessageHandler (target, context, msg, self) {
83 - if (self) { return; } // Ignore messages from the bot 83 +// if (self) { return; } // Ignore messages from the bot
84 84
85 - io.to(target).emit('chatmessage',) 85 +// io.to(target).emit('chatmessage',)
86 - papago.detectchat(msg, client, target); 86 +// papago.detectchat(msg, client, target);
87 87
88 88
89 - if(msg == '척척학사'){ 89 +// if(msg == '척척학사'){
90 - client.say(target, `안녕하세요 척척학사의 방송입니다.`); 90 +// client.say(target, `안녕하세요 척척학사의 방송입니다.`);
91 - } 91 +// }
92 92
93 -} 93 +// }
94 94
95 -// Called every time the bot connects to Twitch chat 95 +// // Called every time the bot connects to Twitch chat
96 -function onConnectedHandler (addr, port) { 96 +// function onConnectedHandler (addr, port) {
97 - console.log(`*KwitchBot Connected to ${addr}:${port}`); 97 +// console.log(`*KwitchBot Connected to ${addr}:${port}`);
98 -} 98 +// }
......