diff options
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/index.ts b/src/index.ts index 42081e6..34cd5f1 100644 --- a/src/index.ts +++ b/src/index.ts | |||
@@ -4,17 +4,17 @@ import config from "./config"; | |||
4 | 4 | ||
5 | (async () => { | 5 | (async () => { |
6 | if (!config.mastodon.token) { | 6 | if (!config.mastodon.token) { |
7 | console.error("MASTODON_TOKEN not set"); | 7 | console.error("MASTODON_TOKEN not set"); |
8 | return; | 8 | return; |
9 | } | 9 | } |
10 | 10 | ||
11 | console.log("Fetching post..."); | 11 | console.log("Fetching post..."); |
12 | 12 | ||
13 | const post = await e621.randomPost(); | 13 | const { queryIndex, post } = await e621.randomPost(); |
14 | const source = post.sources.length ? post.sources[0] : undefined; | 14 | const source = post.sources.length ? post.sources[0] : undefined; |
15 | const cws = config.cw.filter((w) => post.tags.general.includes(w)); | 15 | const cws = config.cw.filter((w) => post.tags.general.includes(w)); |
16 | 16 | ||
17 | console.log(`Got ${post.id}`); | 17 | console.log(`Got ${post.id} via query ${queryIndex}`); |
18 | console.log(`Downloading image...`); | 18 | console.log(`Downloading image...`); |
19 | 19 | ||
20 | const file = await e621.client.get(post.file.url).buffer(); | 20 | const file = await e621.client.get(post.file.url).buffer(); |