Jinsu Park

Update: README.md 오타 커맨드 수정, Add: npm start

......@@ -25,7 +25,7 @@
```bash
$cd server
$npm install pkg.json --save
$npm install
$npm start
```
......
// const tmi = require('tmi.js');
// const papago = require('./openAPIs/papago_api')
// const ttlserver = require('../socket_server')
// // Define configuration options
// var opts = {
// identity: {
// username: process.env.BOT_USERNAME,
// password: process.env.OAUTH_TOKEN
// },
// channels: [
// 'bachelorchuckchuck'
// ]
// };
// // Create a client with our options
// const client = new tmi.client(opts);
// // Register our event handlers (defined below)
// client.on('message', onMessageHandler);
// client.on('connected', onConnectedHandler);
// // Connect to Twitch:
// client.connect();
// // Called every time a message comes in
// function onMessageHandler (target, context, msg, self) {
// if (self) { return; } // Ignore messages from the bot
const tmi = require('tmi.js');
const papago = require('./openAPIs/papago_api')
const ttlserver = require('../socket_server')
// Define configuration options
var opts = {
identity: {
username: process.env.BOT_USERNAME,
password: process.env.OAUTH_TOKEN
},
channels: [
'bachelorchuckchuck'
]
};
// Create a client with our options
const client = new tmi.client(opts);
// Register our event handlers (defined below)
client.on('message', onMessageHandler);
client.on('connected', onConnectedHandler);
// Connect to Twitch:
client.connect();
// Called every time a message comes in
function onMessageHandler (target, context, msg, self) {
if (self) { return; } // Ignore messages from the bot
// client.say(target, `/color `+changecolor());
// papago.detectchat(msg, client, target);
client.say(target, `/color `+changecolor());
papago.detectchat(msg, client, target);
// if(msg == '척척학사'){
// client.say(target, `안녕하세요 척척학사의 방송입니다.`);
// }
if(msg == '척척학사'){
client.say(target, `안녕하세요 척척학사의 방송입니다.`);
}
// }
}
// exports.addChannel = (channel) =>{
// opts.channels.append(channel);
// }
exports.addChannel = (channel) =>{
opts.channels.append(channel);
}
// // Called every time the bot connects to Twitch chat
// function onConnectedHandler (addr, port) {
// console.log(`* Connected to ${addr}:${port}`);
// }
// Called every time the bot connects to Twitch chat
function onConnectedHandler (addr, port) {
console.log(`* Connected to ${addr}:${port}`);
}
......
......@@ -4,6 +4,7 @@
"description": "twitch translator chatbot & tts server dev",
"main": "socket_server.js",
"scripts": {
"start": "node socket_server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Daeyeonkim97",
......