0
的Javascript sqlite3的字符串。當我查詢我的SQLite數據庫中db.each
字符串不會追加使用加法運算符不附加
var messages = "Global Message History: \n\n";
db.each(sql, [Article], (err, row) => {
if (err) {
throw err;
}
console.log(`[${row.message_timestamp}] <@${row.msg_id}> in #${row.channel_name} on Server "${row.server_name}": ${row.message_content}`); //Outputs all messages
messages += `[${row.message_timestamp}] <@${row.msg_id}> in #${row.channel_name} on Server "${row.server_name}": ${row.message_content}\n`; // Doesn't work
});
sendMsg(messages);
sendMsg();
只能與所有的消息一旦被執行,但它似乎沒有工作,輸出僅Global Message History: \n\n
真棒的作品,不知道這存在。謝謝你的協助! – SelectJB