[mod] DB Connect Log
This commit is contained in:
parent
f29639106e
commit
79d240ed2e
@ -84,6 +84,16 @@ class MessageClass {
|
||||
if (profile) {
|
||||
displayName = profile.displayName;
|
||||
}
|
||||
|
||||
//ToJianMiau------------------------------------------------------------------------------------------------------
|
||||
if (userId !== process.env.toZhuHantoJianMiau) {
|
||||
let ToJM_message = `已接收訊息:`;
|
||||
ToJM_message += `\ndisplayName: ${displayName}`;
|
||||
ToJM_message += `\nuserId: ${userId}`;
|
||||
ToJM_message += `\nmessage: ${replyMsg}`;
|
||||
let res_toJianMiau = this.JianMiaubot.push(process.env.toJianMiau, ToJM_message);
|
||||
}
|
||||
|
||||
// JianMiau特別功能
|
||||
if (userId === process.env.toZhuHantoJianMiau || userId === process.env.toZhuHantoZhuHan) {
|
||||
/** 訊息 */
|
||||
|
@ -18,7 +18,7 @@ class Tools_MYSQLDBClass {
|
||||
throw err;
|
||||
}
|
||||
else {
|
||||
console.log("Connection established.");
|
||||
console.log("jianmiau.tk Connect.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
8
app.js
8
app.js
@ -1,7 +1,8 @@
|
||||
// 背景執行 forever start -w app.js
|
||||
// 背景執行 forever start -w -a -l line-cost-js.log app.js
|
||||
// 監聽檔案變化 nodemon "npm start"
|
||||
// Debug node --inspect=192.168.168.15:9229 app.js
|
||||
|
||||
const dateFormat = require('dateformat');
|
||||
require('dotenv').config()
|
||||
// require("./plug/DateFormat");
|
||||
// 引用linebot SDK
|
||||
@ -64,7 +65,8 @@ bot.on('event', function (event) {
|
||||
}
|
||||
});
|
||||
bot.listen(path, port, credentials, function () {
|
||||
console.log(`listening on ${port}`);
|
||||
console.log('[BOT已準備就緒]');
|
||||
let datetime = dateFormat(new Date(), "yyyy-mm-dd HH:MM:ss");
|
||||
console.log(`${datetime} listening on ${port}`);
|
||||
console.log(`${datetime} [BOT已準備就緒]`);
|
||||
// Tools_MYSQLDB.readData();
|
||||
});
|
Reference in New Issue
Block a user