This commit is contained in:
Jay 2018-02-12 23:10:45 +08:00
parent c65d29e81a
commit 57a0995c2f
3 changed files with 13 additions and 4 deletions

View File

@ -9,7 +9,6 @@ ws.on('open', () => {
ws.on('message', (data) => { ws.on('message', (data) => {
if (typeof data !== 'string') data = data.toString() if (typeof data !== 'string') data = data.toString()
}) })
ws.on('error', (err) => { ws.on('error', (err) => {

View File

@ -1,2 +1,12 @@
const pg = require('pg') const {Pool} = require('pg')
const config = require('../config') const config = require('../config')
const pool = new Pool({
user: config.database.user,
password: config.database.pass || null,
port: config.database.port,
host: config.database.host,
database: config.database.db_name
})
module.exports = pool

View File

@ -26,14 +26,14 @@ const msgSplit = function (msg) {
user, user,
msg: '女裝呢!!!?' msg: '女裝呢!!!?'
} }
}else if (m.startsWith('!zoe')) { } else if (m.startsWith('!zoe')) {
return { return {
type: 'msg', type: 'msg',
channel, channel,
user, user,
msg: '跟KKBOX犯沖' msg: '跟KKBOX犯沖'
} }
}else if(m.startsWith('!紫色')) { } else if (m.startsWith('!紫色')) {
return { return {
type: 'msg', type: 'msg',
channel, channel,