diff --git a/datacollector.js b/datacollector.js index a860f25..db23500 100644 --- a/datacollector.js +++ b/datacollector.js @@ -36,7 +36,7 @@ module.exports = function createWSMessageCollector(output) { // output func must if (message instanceof ArrayBuffer) message = Buffer.from(message).toString('base64'); var line = `${Date.now()} ${message}\n`; size += line.length; - fs.appendFile(filepath, line, ()=>{}); + fs.appendFileSync(filepath, line); if (size > 8000000) {save(); size = 0;} }; } \ No newline at end of file diff --git a/mppbridger.js b/mppbridger.js index c857d12..b7b0e37 100644 --- a/mppbridger.js +++ b/mppbridger.js @@ -9,7 +9,7 @@ global.createMPPbridge = async function createMPPbridge({room, channel, uri}) { let msgBuffer = []; function _dSend(options) { - if (options.content.length > 2000) { + if (options.content?.length > 2000) { options.attachments ||= []; options.attachments.push(new Discord.MessageAttachment(Buffer.from(options.content), "message.txt")); delete options.content;