summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-10-17 18:16:13 +0200
committerVolpeon <git@volpeon.ink>2021-10-17 18:16:13 +0200
commitac3ddab720a392e43afb0879b173b7456b3874af (patch)
tree34d0660a2ff36c3608ada97f5be750a9784b1e94
parentInit (diff)
downloadferalbot-ac3ddab720a392e43afb0879b173b7456b3874af.tar.gz
feralbot-ac3ddab720a392e43afb0879b173b7456b3874af.tar.bz2
feralbot-ac3ddab720a392e43afb0879b173b7456b3874af.zip
Detect if Mastodon token is not set
-rw-r--r--package.json3
-rw-r--r--src/index.ts5
2 files changed, 8 insertions, 0 deletions
diff --git a/package.json b/package.json
index 01dabf4..a88dbf9 100644
--- a/package.json
+++ b/package.json
@@ -5,6 +5,9 @@
5 "author": "Volpeon", 5 "author": "Volpeon",
6 "license": "MIT", 6 "license": "MIT",
7 "private": true, 7 "private": true,
8 "scripts": {
9 "start": "node -r ts-node/register src/index.ts"
10 },
8 "dependencies": { 11 "dependencies": {
9 "@types/sharp": "^0.29.2", 12 "@types/sharp": "^0.29.2",
10 "file-type": "^16.5.3", 13 "file-type": "^16.5.3",
diff --git a/src/index.ts b/src/index.ts
index 7185e23..42081e6 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -3,6 +3,11 @@ import * as mastodon from "./api/mastodon";
3import config from "./config"; 3import config from "./config";
4 4
5(async () => { 5(async () => {
6 if (!config.mastodon.token) {
7 console.error("MASTODON_TOKEN not set");
8 return;
9 }
10
6 console.log("Fetching post..."); 11 console.log("Fetching post...");
7 12
8 const post = await e621.randomPost(); 13 const post = await e621.randomPost();