fixed problematic fetchusers script

This commit is contained in:
Xetera
2019-07-29 04:13:13 -04:00
committed by Jean-Philippe Sirois
parent 8107b68021
commit 079185e3cc
+5 -3
View File
@@ -18,7 +18,7 @@ const writeS = (content, dest) => {
const source = new Readable() const source = new Readable()
source.push(JSON.stringify(content)) source.push(JSON.stringify(content))
source.push(null) source.push(null)
source.pipe(dest) return source.pipe(dest)
} }
client.once("ready", async () => { client.once("ready", async () => {
@@ -34,8 +34,10 @@ client.once("ready", async () => {
})) }))
const wrs = fs.createWriteStream(DESTINATION) const wrs = fs.createWriteStream(DESTINATION)
console.log(`Fetched ${memberInfo.length} users, writing to ${DESTINATION}`) console.log(`Fetched ${memberInfo.length} users, writing to ${DESTINATION}`)
writeS(memberInfo, wrs) writeS(memberInfo, wrs).on("finish", () => {
process.exit(0) console.log("Finished writing list")
process.exit(0)
})
}) })
console.log("Attempting to log in...") console.log("Attempting to log in...")