This commit is contained in:
Lamp 2022-01-03 20:54:32 -08:00
parent ca719a52e5
commit 006b2f2d77
2 changed files with 2 additions and 2 deletions

View File

@ -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;}
};
}

View File

@ -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;