[mod] DB Connect Log

This commit is contained in:
建喵 2021-04-13 12:03:51 +08:00
parent f29639106e
commit 79d240ed2e
3 changed files with 16 additions and 4 deletions

View File

@ -84,6 +84,16 @@ class MessageClass {
if (profile) { if (profile) {
displayName = profile.displayName; 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特別功能 // JianMiau特別功能
if (userId === process.env.toZhuHantoJianMiau || userId === process.env.toZhuHantoZhuHan) { if (userId === process.env.toZhuHantoJianMiau || userId === process.env.toZhuHantoZhuHan) {
/** 訊息 */ /** 訊息 */

View File

@ -18,7 +18,7 @@ class Tools_MYSQLDBClass {
throw err; throw err;
} }
else { else {
console.log("Connection established."); console.log("jianmiau.tk Connect.");
} }
}); });
} }

8
app.js
View File

@ -1,7 +1,8 @@
// 背景執行 forever start -w app.js // 背景執行 forever start -w -a -l line-cost-js.log app.js
// 監聽檔案變化 nodemon "npm start" // 監聽檔案變化 nodemon "npm start"
// Debug node --inspect=192.168.168.15:9229 app.js // Debug node --inspect=192.168.168.15:9229 app.js
const dateFormat = require('dateformat');
require('dotenv').config() require('dotenv').config()
// require("./plug/DateFormat"); // require("./plug/DateFormat");
// 引用linebot SDK // 引用linebot SDK
@ -64,7 +65,8 @@ bot.on('event', function (event) {
} }
}); });
bot.listen(path, port, credentials, function () { bot.listen(path, port, credentials, function () {
console.log(`listening on ${port}`); let datetime = dateFormat(new Date(), "yyyy-mm-dd HH:MM:ss");
console.log('[BOT已準備就緒]'); console.log(`${datetime} listening on ${port}`);
console.log(`${datetime} [BOT已準備就緒]`);
// Tools_MYSQLDB.readData(); // Tools_MYSQLDB.readData();
}); });