This commit is contained in:
max 2023-03-31 04:06:34 +00:00
parent 4164a9f836
commit e0f4c458f5
3 changed files with 0 additions and 38 deletions

2
bot.js
View file

@ -21,8 +21,6 @@ const data1 = fspkg.readFile('dataset1.json', 'utf8', (error, data) => {
console.log(JSON.parse(data)); console.log(JSON.parse(data));
}) })
const status = await masto.v1.statuses.create ({ const status = await masto.v1.statuses.create ({
status: `${data1} selfcare! 🌸`, status: `${data1} selfcare! 🌸`,
visibility: 'public', visibility: 'public',

34
bot2.js
View file

@ -1,34 +0,0 @@
import * as dotenv from 'dotenv';
dotenv.config();
import { login } from 'masto';
import expresspkg from 'express';
const { jsonContent } = expresspkg;
import * as fspkg from 'fs';
const { fs } = fspkg;
console.log("selfcarebot is starting...");
const masto = await login({
url: process.env.URL,
accessToken: process.env.ACCESS_TOKEN,
});
const jsonData = JSON.parse(fspkg.readFileSync('dataset1.json', 'utf-8', (error, data, status) => {
if (error){
console.log(error);
return;
}
console.log(JSON.parse(data));
console.log(JSON.parse(status));
}))
const stat = jsonData[stat];
var random = jsonData[stat][Math.floor(Math.random()*jsonContent[stat].length)];
const stati = await masto.statuses.create({
status: `${random} selfcare! 🌸`,
visibility: 'public',
});
console.log(stati.url);

2
clip
View file

@ -1,2 +0,0 @@
"type": "module",