From beb00c53c8f088ea479f5a28292ad3a2b091e1d5 Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Thu, 6 Jan 2022 08:08:07 -0600 Subject: [PATCH] Change naming, make required node version obvious Signed-off-by: Sam Therapy --- README.md | 9 +++++---- config.sample.jsonc | 2 +- package.json | 4 ++-- src/{bot.ts => local.ts} | 0 4 files changed, 8 insertions(+), 7 deletions(-) rename src/{bot.ts => local.ts} (100%) diff --git a/README.md b/README.md index 5c83583..8136a07 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,13 @@ [![Build Status](https://ci.rint.osaka/api/badges/NotSam/fediverse-imagebot/status.svg)](https://ci.rint.osaka/NotSam/fediverse-imagebot) -A bot that posts images to the Fediverse. +A bot that posts (currently only local) images to the Fediverse. Should be compatible with Mastodon, Misskey and Pleroma! ## Quick start guide 1. You need to have `npm` and `nodejs` installed. +- Node 15 or greater is required. 2. Install `yarn`: \ `npm install --global yarn` @@ -29,7 +30,7 @@ Should be compatible with Mastodon, Misskey and Pleroma! - By default the bot will look for SFW images at `images/sfw` and NSFW images at `images/nsfw`. This can be configured. 8. Run the bot: \ -`yarn bot` +`yarn local` You're done! The bot should post an image to the fediverse instance of your choosing! @@ -39,10 +40,10 @@ You're done! The bot should post an image to the fediverse instance of your choo The bot can be automated to post images at set times using a cronjob. \ Example cron configuration: ``` -0 * * * * cd /path/to/fediverse-imagebot && yarn bot -m "Message" +0 * * * * cd /path/to/fediverse-imagebot && yarn local -m "Message" ``` This example will run the bot every hour on the hour with the post message `Message`. ## Additional information -Additional help can be found by running `yarn bot -h` or `yarn token -h`. +Additional help can be found by running `yarn local -h` or `yarn token -h`. diff --git a/config.sample.jsonc b/config.sample.jsonc index 6359dbc..6af29a8 100644 --- a/config.sample.jsonc +++ b/config.sample.jsonc @@ -4,5 +4,5 @@ "instance": "INSTANCE_URL", // example https://test.com "type": "INSTANCE_TYPE", // examples: "mastodon", "misskey", "pleroma" "accessToken": "ACCESS_TOKEN", - "refreshToken": "REFRESH_TOKEN" + "refreshToken": "REFRESH_TOKEN" // This can be left blank, as it is currently not used for anything. } \ No newline at end of file diff --git a/package.json b/package.json index c17ba77..a29c395 100644 --- a/package.json +++ b/package.json @@ -13,13 +13,13 @@ "name": "fediverse-imagebot", "version": "0.1.0", "description": "Image bot for the fediverse (Pleroma, Mastodon, Misskey)", - "main": "dist/bot.js", + "main": "dist/local.js", "scripts": { "build": "yarn run clean && tsc", "clean": "rm -rf dist", "token": "node ./dist/gen-token.js", "lint": "eslint --ext .ts src", - "bot": "node ./dist/bot.js", + "local": "node ./dist/local.js", "test": "echo \"No tests yet!\" && exit 0" }, diff --git a/src/bot.ts b/src/local.ts similarity index 100% rename from src/bot.ts rename to src/local.ts