From 8b0ed2c36f9fce6d74ad1da09a1fe88858ba2acc Mon Sep 17 00:00:00 2001 From: max Date: Thu, 30 Mar 2023 06:13:55 +0000 Subject: [PATCH] m --- bot.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot.js b/bot.js index 7e4121d..e6264fc 100644 --- a/bot.js +++ b/bot.js @@ -1,10 +1,10 @@ import * as dotenv from 'dotenv'; dotenv.config(); - import pkg from 'express'; const { Express } = pkg; - import { login } from 'masto'; +import * as fspkg from 'fs'; +const { fs } = fspkg; const masto = await login({ url: process.env.URL, @@ -18,10 +18,11 @@ const M = await masto.v1.statuses.create ({ visibility: 'public', }); -M.post('statuses', params, (error, data) => { +M.post('statuses', (error, data) => { if (error) { console.error(error); } else { + fs.writeFileSync('data.json', JSON.stringify(data, null, 2)); console.log(data); } }