I am writing a bot for the VC talk and I need to write the data of this format to the file on command. id - taken from message.date sub - first hw argument - second time argument - third argument Then, with the output command, I need to output all this data with one message, filtering first by time (day of the week, for example, Monday), then by sub. As a result, the following message should appear: Monday id. sub - hw, etc. The question is this. How to write all this into a json file, and then output as I need? I use VK-Promise Here is the code:
vk.on("message",function (event, message) { // Обрабатываем сообщения const args = message.body.split(" ").slice(1); if (message.body.startsWith(config.prefix + "add")) { let sub = args[0] let hw = args[1] let time = args[2] if(!sub||!hw||!time){ message.send(`Ошибка! Отправьте сообщение по такому шаблону : ${config.prefix}add предмет д\з день недели`) }else { message.send(`Домашнее задание (${hw}) на (${time}) по ${sub} добавлено!`) } } });