ugh
This commit is contained in:
parent
4164a9f836
commit
e0f4c458f5
3 changed files with 0 additions and 38 deletions
2
bot.js
2
bot.js
|
@ -21,8 +21,6 @@ const data1 = fspkg.readFile('dataset1.json', 'utf8', (error, data) => {
|
|||
console.log(JSON.parse(data));
|
||||
})
|
||||
|
||||
|
||||
|
||||
const status = await masto.v1.statuses.create ({
|
||||
status: `${data1} selfcare! 🌸`,
|
||||
visibility: 'public',
|
||||
|
|
34
bot2.js
34
bot2.js
|
@ -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
2
clip
|
@ -1,2 +0,0 @@
|
|||
"type": "module",
|
||||
|
Loading…
Reference in a new issue