GeekyDeaks / discord-destinybot

Discord Destiny Bot
MIT License
8 stars 3 forks source link

verify manifest and update msg to chat #10

Closed unisys12 closed 7 years ago

unisys12 commented 7 years ago

Passed optional flags to createWriteStream, on line 50, to check if the file path exists already and if not, create it. If it does exists already, it truncates the file and writes to the now empty file. Then used fs.stat to check that the file actually exists after creation. Throws log error if not. Also updated busyMsg upon success.

Not sure if you are ok with lines 52-58, since I am using a callback. Other than creating another file for general utility style methods such as this, I decided to just leave it in for now. Also just removed some of the general comments we had throughout the file.

GeekyDeaks commented 7 years ago

Thanks for this! Don't worry too much about style at the moment. To be honest this was an experiment with generators, but I am encountering a few quirks when using them under the debugger so we might need to consider using promises or traditional callbacks a little more.