This one makes no sense to me on multiple levels...Here is a snippet of output; first showing the variable that was written to the file "gm" ... then a file list... and then the output of the "gm" file, enclosed in square braces. Two things are wrong here. First, the last digit of the number has changed! Second, there are spaces between the curly braces and the number? That's not in my code!!Wrote 360086569778020352 DX: File list ----------------- IDs --------------------- parents gm (1bOxdjpxRaYszWkpA3vZk4OQV3q_5Jis_) [1CSiXlOb0CNMKmBzuqaVdnud_-MJJRCn_] 360086569778020352 (1CSiXlOb0CNMKmBzuqaVdnud_-MJJRCn_) [1-KMQX1zuVfpbGzwm5FprEG1uEU5EcueL] 603024812813844481 (1-KMQX1zuVfpbGzwm5FprEG1uEU5EcueL) [1fyfeTRhnAZtT6tUgLmR156f6Bm69zg_o] 391692854617178132 (1fyfeTRhnAZtT6tUgLmR156f6Bm69zg_o) [1G-2tzJPjetAGzKDZruoJKEF_7NvlHW9j] UserData (1G-2tzJPjetAGzKDZruoJKEF_7NvlHW9j) [0AI0Vi29qM1FOUk9PVA] [ 360086569778020350 ] The code that created this output:Writing: lockDiskForChannel(msg.channel.id); drive.files.create({ resource: { 'name': "gm", 'parents': [userFolderID] }, media: { 'mimeType': 'text/plain', 'body': `[${targetID}]` }, fields: 'id' }, (err, file) => { if (err) return console.error(err); unlockDiskForChannel(msg.channel.id); console.log(`Wrote ${targetID}`); } ); while (isDiskLockedForChannel(msg.channel.id)) { await sleep(25); } listAllFiles(); ...and reading:function openFile(args) { var auth = global.auth; const drive = google.drive({version: 'v3', auth}); drive.files.get({fileId: args[0], alt: "media"}, (err, res) => { if (err) return console.error(err); console.log(res.data); }); } Is there something dirty about my data that only triggers when you assign to media.body? Am I maybe reading the data the wrong way? The targetID variable is created thusly: var targetID = args[0].substring(3, args[0].length-1); (Which strips discord's @<34234234234234234234> format down to just the ID number.)
Submitted November 09, 2019 at 04:23PM by AstroMacGuffin
No comments:
Post a Comment