From 485b41fd3bfe183b7ae73225c341c9618220e981 Mon Sep 17 00:00:00 2001 From: Ategon Date: Wed, 20 Dec 2023 00:57:37 -0500 Subject: [PATCH] Update to handle 0.19 --- config.yaml | 29 +- main.js | 710 ++++++++++++++++++++++++++-------------------- package-lock.json | 49 ++-- package.json | 2 +- 4 files changed, 440 insertions(+), 350 deletions(-) diff --git a/config.yaml b/config.yaml index a1539e8..cecf743 100644 --- a/config.yaml +++ b/config.yaml @@ -1,5 +1,5 @@ --- -# Whether to give the bot a bot tag (true) or not (false). Recommended to mark it but the option is here if you already +# Whether to give the bot a bot tag (true) or not (false). Recommended to mark it but the option is here if you already # marked it manually and it starts throwing user_already_exists errors markAsBot: true @@ -11,12 +11,12 @@ dayCheckInterval: 10 # The timezone to use for the bot (as reference for unpinning posts at midnight) # You can see the options here: https://www.inmotionhosting.com/support/website/tz-ref-table/ -timezone: 'America/Toronto' +timezone: "America/Toronto" # Posts from how many days ago are you willing to backpost when the bot starts dayCutOff: 7 -# Set to true to add all posts to the db without posting them. Good to set for one run to clear out backposts if you +# Set to true to add all posts to the db without posting them. Good to set for one run to clear out backposts if you # dont want any old posts posted when the bot is first ran. Set to false to post normally stopPosts: false @@ -30,10 +30,8 @@ maxPosts: 5 # The time in milliseconds it will sleep before doing another post in the same post check postSleepDuration: 5000 - # ------------------------------------------------------------------------------ - # The instances and communities used by the bot instances: programming.dev: # The instance name @@ -46,23 +44,20 @@ instances: unity: - "unity" - # The rss feeds used to pull posts from feeds: godot: # The name of the feed (used in the instances section to mark feed to use) - url: 'https://godotengine.org/rss.xml' + url: "https://godotengine.org/rss.xml" pinCategories: # If a bot has a category section that lists this category, pin it for the amount of days - Release: 7 - Pre-release: 7 unreal: - url: 'https://www.unrealengine.com/en-US/rss' - content: 'summary' + url: "https://www.unrealengine.com/en-US/rss" + content: "summary" unity: - url: 'https://blogs.unity3d.com/feed/' - - + url: "https://blogs.unity3d.com/feed/" # Additional possible values: # joinfeeds will only include posts in common between the source feed and those in the list - It is processed first # exclude will remove posts from the feed based on the contents of another feed - It is processed second. @@ -77,17 +72,17 @@ feeds: # feeds: # example: # The name of the feed (used in the instances section to mark feed to use) # url: 'https://example.com/rss' -# pinCategories: +# pinCategories: # - News: 7 # content: 'summary' # datefield: 'pubDate' -# joinfeeds: +# joinfeeds: # - 'example2' # the feed contains posts from example2, which we want. So we join example2 to get posts that are in both example and example2. # exclude: # - 'example3' # the feed contains posts from example3, which we don't want. So we exclude example3 to get posts that are in example only. -# +# # example2: # url: 'https://example.com/rss2' -# +# # example3: -# url: 'https://example.com/rss3' \ No newline at end of file +# url: 'https://example.com/rss3' diff --git a/main.js b/main.js index fac9197..5d16d71 100644 --- a/main.js +++ b/main.js @@ -1,384 +1,476 @@ -import LemmyBot from 'lemmy-bot'; -import chalk from 'chalk'; -import sqlite3 from 'sqlite3'; -import Parser from 'rss-parser'; -import { load } from 'js-yaml' -import 'dotenv/config'; -import { readFileSync } from 'fs'; +import LemmyBot from "lemmy-bot"; +import chalk from "chalk"; +import sqlite3 from "sqlite3"; +import Parser from "rss-parser"; +import { load } from "js-yaml"; +import "dotenv/config"; +import { readFileSync } from "fs"; let parser = new Parser({ - customFields: { - item: ['image'], - } + customFields: { + item: ["image"], + }, }); -console.log(`${chalk.magenta('STARTED:')} Started Bot`) - -let { instances, feeds, markAsBot, postCheckInterval, dayCheckInterval, timezone, dayCutOff, stopPosts, showLogs, postSleepDuration, maxPosts } = load(readFileSync('config.yaml', 'utf8')); +console.log(`${chalk.magenta("STARTED:")} Started Bot`); + +let { + instances, + feeds, + markAsBot, + postCheckInterval, + dayCheckInterval, + timezone, + dayCutOff, + stopPosts, + showLogs, + postSleepDuration, + maxPosts, +} = load(readFileSync("config.yaml", "utf8")); markAsBot = markAsBot ?? true; postCheckInterval = postCheckInterval ?? 10; dayCheckInterval = dayCheckInterval ?? 10; -timezone = timezone ?? 'America/Toronto'; +timezone = timezone ?? "America/Toronto"; dayCutOff = dayCutOff ?? 7; stopPosts = stopPosts ?? false; showLogs = showLogs ?? false; postSleepDuration = postSleepDuration ?? 2000; maxPosts = maxPosts ?? 5; -log(`${chalk.grey('INSTANCES:')} ${Object.keys(instances).length} instances loaded.`) -log(`${chalk.grey('FEEDS:')} ${Object.keys(feeds).length} feeds loaded.`) +log( + `${chalk.grey("INSTANCES:")} ${ + Object.keys(instances).length + } instances loaded.` +); +log(`${chalk.grey("FEEDS:")} ${Object.keys(feeds).length} feeds loaded.`); function log(message) { - if (showLogs) { - console.log(message); - } + if (showLogs) { + console.log(message); + } } // ----------------------------------------------------------------------------- // Databases -const db = new sqlite3.Database('mega.sqlite3', (err) => { - if (err) { - return console.error(err.message); - } - log(`${chalk.green('DB:')} Connected to the database.`); +const db = new sqlite3.Database("mega.sqlite3", (err) => { + if (err) { + return console.error(err.message); + } + log(`${chalk.green("DB:")} Connected to the database.`); - db.run(`CREATE TABLE IF NOT EXISTS posts ( + db.run( + `CREATE TABLE IF NOT EXISTS posts ( id INTEGER PRIMARY KEY AUTOINCREMENT, link TEXT NOT NULL UNIQUE, pin_days INTEGER NOT NULL DEFAULT 0, post_id TEXT, featured INTEGER DEFAULT 0 - )`, (err) => { - if (err) { - return console.error(err.message); - } - log(`${chalk.grey('TABLE:')} Loaded posts table.`); - }); + )`, + (err) => { + if (err) { + return console.error(err.message); + } + log(`${chalk.grey("TABLE:")} Loaded posts table.`); + } + ); - db.run(`CREATE TABLE IF NOT EXISTS time ( + db.run( + `CREATE TABLE IF NOT EXISTS time ( key TEXT PRIMARY KEY, value INTEGER - )`, (err) => { - if (err) { - return console.error(err.message); - } - log(`${chalk.grey('TABLE:')} Loaded time table`); - - db.run(`INSERT OR IGNORE INTO time (key, value) VALUES ('day', 0)`, (err) => { - if (err) { - return console.error(err.message); - } - }); - }); + )`, + (err) => { + if (err) { + return console.error(err.message); + } + log(`${chalk.grey("TABLE:")} Loaded time table`); - // get all posts - db.all(`SELECT COUNT(*) as count FROM posts`, (err, rows) => { - if (err) { + db.run( + `INSERT OR IGNORE INTO time (key, value) VALUES ('day', 0)`, + (err) => { + if (err) { return console.error(err.message); + } } + ); + } + ); + + // get all posts + db.all(`SELECT COUNT(*) as count FROM posts`, (err, rows) => { + if (err) { + return console.error(err.message); + } - log(`${chalk.grey('POSTS:')} ${rows[0].count} posts in database.`) - }); + log(`${chalk.grey("POSTS:")} ${rows[0].count} posts in database.`); + }); }); // ----------------------------------------------------------------------------- // Main Bot Code function sleep(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); + return new Promise((resolve) => setTimeout(resolve, ms)); } // Create the list of communities the bot will be interacting in -const allowList = [] +const allowList = []; for (const [instance, communities] of Object.entries(instances)) { - allowList.push({ - instance: instance, - communities: Object.keys(communities) - }) + allowList.push({ + instance: instance, + communities: Object.keys(communities), + }); } // Log in const bot = new LemmyBot.LemmyBot({ - instance: process.env.LEMMY_INSTANCE, - credentials: { - username: process.env.LEMMY_USERNAME, - password: process.env.LEMMY_PASSWORD, - }, - dbFile: 'db.sqlite3', - federation: { - allowList: allowList, - }, - handlers: { - post: { - handle: async ({ - postView: { - post, - creator - }, - botActions: { featurePost }, - }) => { - // Pin post if its by the bot and set to be pinned - if (creator.name == process.env.LEMMY_USERNAME) { - // get link from db. If pin days > 0 then pin - db.all(`SELECT * FROM posts WHERE link = ?`, [post.url], async (err, rows) => { - if (err) { - return console.error(err.message); - } - - if (rows.length > 0) { - if (rows[0].featured) { - // Pin post - await featurePost({postId: post.id, featureType: "Community", featured: true}) - log(`${chalk.green('PINNED:')} Pinned ${post.name} in ${post.community_id} by ${creator.name}`) - - // Update post in db - db.run(`UPDATE posts SET post_id = ? WHERE link = ?`, [post.id, post.url], (err) => { - if (err) { - return console.error(err.message); - } - }); - } - } - }); + instance: process.env.LEMMY_INSTANCE, + credentials: { + username: process.env.LEMMY_USERNAME, + password: process.env.LEMMY_PASSWORD, + }, + dbFile: "db.sqlite3", + federation: { + allowList: allowList, + }, + handlers: { + post: { + handle: async ({ + postView: { post, creator }, + botActions: { featurePost }, + }) => { + // Pin post if its by the bot and set to be pinned + if (creator.name == process.env.LEMMY_USERNAME) { + // get link from db. If pin days > 0 then pin + db.all( + `SELECT * FROM posts WHERE link = ?`, + [post.url], + async (err, rows) => { + if (err) { + return console.error(err.message); + } + + if (rows.length > 0) { + if (rows[0].featured) { + // Pin post + await featurePost({ + postId: post.id, + featureType: "Community", + featured: true, + }); + log( + `${chalk.green("PINNED:")} Pinned ${post.name} in ${ + post.community_id + } by ${creator.name}` + ); + + // Update post in db + db.run( + `UPDATE posts SET post_id = ? WHERE link = ?`, + [post.id, post.url], + (err) => { + if (err) { + return console.error(err.message); + } + } + ); } + } } + ); } + }, }, - markAsBot: markAsBot, - schedule: [ - { - cronExpression: `0 */${postCheckInterval} * * * *`, - timezone: timezone, - doTask: async ({getCommunityId, createPost}) => { - log(`${chalk.cyan('STARTED:')} RSS Feed Fetcher.`); - for (const [name, feed] of Object.entries(feeds)) { - const rss = await parser.parseURL(feed.url); - - const cutoffDate = new Date(); - cutoffDate.setDate(cutoffDate.getDate() - dayCutOff); - - let joinedItems = []; - // gather all items from feeds to be joined - if (feed.joinfeeds) { - log(`${chalk.grey('FETCHING:')} joining feeds for ${name}`); - for (const joinFeedName of feed.joinfeeds) { - const joinFeed = Object.entries(feeds).find(f => f[0] === joinFeedName); - - if (joinFeed) { - const joinRss = await parser.parseURL(joinFeed[1].url); - joinedItems = joinedItems.concat(joinRss.items); - } - } - } - - let excludeItems = []; - // exclude feeds - if (feed.exclude) { - log(`${chalk.grey('FETCHING:')} exclusion feeds for ${name}`); - for (const excludeFeedName of feed.exclude) { - const excludeFeed = Object.entries(feeds).find(f => f[0] === excludeFeedName); - - if (excludeFeed) { - const excludeRss = await parser.parseURL(excludeFeed[1].url); - for (const excludeItem of excludeRss.items) { - excludeItems.push(excludeItem.link); - } - } - } + }, + markAsBot: markAsBot, + schedule: [ + { + cronExpression: `0 */${postCheckInterval} * * * *`, + timezone: timezone, + doTask: async ({ botActions: { getCommunityId, createPost } }) => { + log(`${chalk.cyan("STARTED:")} RSS Feed Fetcher.`); + for (const [name, feed] of Object.entries(feeds)) { + const rss = await parser.parseURL(feed.url); + + const cutoffDate = new Date(); + cutoffDate.setDate(cutoffDate.getDate() - dayCutOff); + + let joinedItems = []; + // gather all items from feeds to be joined + if (feed.joinfeeds) { + log(`${chalk.grey("FETCHING:")} joining feeds for ${name}`); + for (const joinFeedName of feed.joinfeeds) { + const joinFeed = Object.entries(feeds).find( + (f) => f[0] === joinFeedName + ); + + if (joinFeed) { + const joinRss = await parser.parseURL(joinFeed[1].url); + joinedItems = joinedItems.concat(joinRss.items); + } + } + } + + let excludeItems = []; + // exclude feeds + if (feed.exclude) { + log(`${chalk.grey("FETCHING:")} exclusion feeds for ${name}`); + for (const excludeFeedName of feed.exclude) { + const excludeFeed = Object.entries(feeds).find( + (f) => f[0] === excludeFeedName + ); + + if (excludeFeed) { + const excludeRss = await parser.parseURL(excludeFeed[1].url); + for (const excludeItem of excludeRss.items) { + excludeItems.push(excludeItem.link); + } + } + } + } + + let commonItems = rss.items.filter((item) => { + if (feed.joinfeeds && feed.exclude) { + return ( + joinedItems.map((i) => i.link).includes(item.link) && + !excludeItems.includes(item.link) + ); + } else if (feed.joinfeeds) { + return joinedItems.map((i) => i.link).includes(item.link); + } else if (feed.exclude) { + return !excludeItems.includes(item.link); + } else { + return true; + } + }); + + let donePosts = 0; + + for (const item of commonItems) { + let pin_days = 0; + const itemDate = new Date( + (feed.datefield ? item[feed.datefield] : item.pubDate).trim() + ); + //if item is newer than cutoff continue + if (itemDate > cutoffDate) { + // if has categories then see if it's a pin + if (feed.pinCategories && item.categories) { + for (const category of item.categories) { + const found_category = feed.pinCategories.find( + (c) => c.name === category + ); + if (found_category) { + pin_days = found_category.days; + } + } + } + + db.run( + `INSERT INTO posts (link, pin_days, featured) VALUES (?, ?, ?)`, + [item.link, pin_days, pin_days > 0 ? 1 : 0], + async (err) => { + if (err) { + if (err.message.includes("UNIQUE constraint failed")) { + // do nothing + return; + } else { + return console.error(err.message); } + } + log( + `${chalk.yellow("INSERTED:")} ${item.link} into database.` + ); + + if (stopPosts) return; + + for (const [instance, communities] of Object.entries( + instances + )) { + for (const [community, value] of Object.entries( + communities + )) { + if (maxPosts != 0 && donePosts >= maxPosts) { + log(`${chalk.green("COMPLETE:")} Max posts reached.`); + return; + } + + if (Object.values(value).includes(name)) { + log( + `${chalk.grey("CREATING:")} post for link ${ + item.link + } in ${community}` + ); + const communityId = await getCommunityId({ + name: community, + instance: instance, + }); - let commonItems = rss.items.filter(item => { - if (feed.joinfeeds && feed.exclude) { - return joinedItems.map(i => i.link).includes(item.link) && !excludeItems.includes(item.link); - } else if (feed.joinfeeds) { - return joinedItems.map(i => i.link).includes(item.link); - } else if (feed.exclude) { - return !excludeItems.includes(item.link); - } else { - return true; + let title = item.title; + title = parseTags(title); + + let body = + feed.content && feed.content === "summary" + ? item.summary + : item.content; + body = parseTags(body); + + try { + donePosts++; + await createPost({ + name: title, + body: body, + url: item.link || undefined, + community_id: communityId, + }); + } catch (e) { + console.error(e); } - }); - - let donePosts = 0; - - for (const item of commonItems) { - let pin_days = 0; - const itemDate = new Date((feed.datefield ? item[feed.datefield] : item.pubDate).trim()); - //if item is newer than cutoff continue - if (itemDate > cutoffDate) { - // if has categories then see if it's a pin - if (feed.pinCategories && item.categories) { - for (const category of item.categories) { - const found_category = feed.pinCategories.find(c => c.name === category); - if (found_category) { - pin_days = found_category.days; - } - } - } - - db.run(`INSERT INTO posts (link, pin_days, featured) VALUES (?, ?, ?)`, [item.link, pin_days, pin_days > 0 ? 1 : 0], async (err) => { - if (err) { - if (err.message.includes('UNIQUE constraint failed')) { - // do nothing - return; - } else { - return console.error(err.message); - } - } - log(`${chalk.yellow('INSERTED:')} ${item.link} into database.`); - - if (stopPosts) return; - - for (const [instance, communities] of Object.entries(instances)) { - for (const [community, value] of Object.entries(communities)) { - if (maxPosts != 0 && donePosts >= maxPosts) { - log(`${chalk.green('COMPLETE:')} Max posts reached.`); - return; - } - - if (Object.values(value).includes(name)) { - log(`${chalk.grey('CREATING:')} post for link ${item.link} in ${community }`); - const communityId = await getCommunityId({ name: community, instance: instance }); - - let title = item.title; - title = parseTags(title); - - let body = ((feed.content && feed.content === 'summary') ? item.summary : item.content); - body = parseTags(body); - - try { - donePosts++; - await createPost({ - name: title, - body: body, - url: item.link || undefined, - community_id: communityId, - }); - } catch (e) { - console.error(e); - } - await sleep(postSleepDuration); - } - } - } - }); - } - + await sleep(postSleepDuration); + } } - log(`${chalk.green('COMPLETE:')} Feed ${name} processed.`); + } } + ); } - }, - { - cronExpression: `0 */${dayCheckInterval} * * * *`, - timezone: 'America/Toronto', - doTask: async ({ featurePost }) => { - const now = addMinutes(new Date(), 30); - const day = now.getDay(); - - db.get(`SELECT value FROM time WHERE key = 'day'`, (err, row) => { + } + log(`${chalk.green("COMPLETE:")} Feed ${name} processed.`); + } + }, + }, + { + cronExpression: `0 */${dayCheckInterval} * * * *`, + timezone: "America/Toronto", + doTask: async ({ botActions: { featurePost } }) => { + const now = addMinutes(new Date(), 30); + const day = now.getDay(); + + db.get(`SELECT value FROM time WHERE key = 'day'`, (err, row) => { + if (err) { + return console.error(err.message); + } + + if (row.value !== day) { + db.run( + `UPDATE time SET value = ${day} WHERE key = 'day'`, + (err) => { + if (err) { + return console.error(err.message); + } + } + ); + + log(`${chalk.magenta("TIME:")} Updated day to ${day}`); + // decrement all post times by 1 + db.run( + `UPDATE posts SET pin_days = pin_days - 1 WHERE featured = 1`, + (err) => { + if (err) { + return console.error(err.message); + } + + log(`${chalk.magenta("TIME:")} Decremented all post times`); + + // get all posts with 0 days left and unpin them + db.all( + `SELECT * FROM posts WHERE pin_days = 0 && featured = 1`, + async (err, rows) => { if (err) { - return console.error(err.message); + return console.error(err.message); } - if (row.value !== day) { - db.run(`UPDATE time SET value = ${day} WHERE key = 'day'`, (err) => { - if (err) { - return console.error(err.message); - } - }); - - log(`${chalk.magenta('TIME:')} Updated day to ${day}`); - // decrement all post times by 1 - db.run(`UPDATE posts SET pin_days = pin_days - 1 WHERE featured = 1`, (err) => { - if (err) { - return console.error(err.message); - } - - log(`${chalk.magenta('TIME:')} Decremented all post times`); - - // get all posts with 0 days left and unpin them - db.all(`SELECT * FROM posts WHERE pin_days = 0 && featured = 1`, async (err, rows) => { - if (err) { - return console.error(err.message); - } - - for (const row of rows) { - await featurePost({postId: row.post_id, featureType: "Community", featured: false}) - log(`${chalk.green('UNFEATURED:')} Unfeatured ${row.post_id}`); - } - - // set all posts with 0 days left to unfeatured - db.run(`UPDATE posts SET featured = 0 WHERE pin_days = 0 AND featured = 1`, (err) => { - if (err) { - return console.error(err.message); - } - - log(`${chalk.magenta('TIME:')} Unfeatured all posts with 0 days left`); - }); - }); - }); + for (const row of rows) { + await featurePost({ + postId: row.post_id, + featureType: "Community", + featured: false, + }); + log( + `${chalk.green("UNFEATURED:")} Unfeatured ${ + row.post_id + }` + ); } - }); - } - } - ], + + // set all posts with 0 days left to unfeatured + db.run( + `UPDATE posts SET featured = 0 WHERE pin_days = 0 AND featured = 1`, + (err) => { + if (err) { + return console.error(err.message); + } + + log( + `${chalk.magenta( + "TIME:" + )} Unfeatured all posts with 0 days left` + ); + } + ); + } + ); + } + ); + } + }); + }, + }, + ], }); let tags = { - '': '**', - '': '**', - '

': '', - '

': '', - '': '**', - '': '**', - '
': '\n', - '
': '\n', - '
': '\n', - ' ': ' ', - '
    ': '', - '
': '', - '
  • ': '- ', - '
  • ': '', - '': '\n', - ' ': ' ', -} + "": "**", + "": "**", + "

    ": "", + "

    ": "", + "": "**", + "": "**", + "
    ": "\n", + "
    ": "\n", + "
    ": "\n", + " ": " ", + "
      ": "", + "
    ": "", + "
  • ": "- ", + "
  • ": "", + "": "\n", + " ": " ", +}; function parseTags(input) { - let output = input; - for (const [key, value] of Object.entries(tags)) { - output = output.replaceAll(key, value); - } - - // Fix Links - const linkRegex = /([^<]+)<\/a>/g; - let match; + let output = input; + for (const [key, value] of Object.entries(tags)) { + output = output.replaceAll(key, value); + } + + // Fix Links + const linkRegex = /([^<]+)<\/a>/g; + let match; + match = linkRegex.exec(output); + while (match != null) { + output = output.replace(match[0], `[${match[2]}](${match[1]})`); match = linkRegex.exec(output); - while (match != null) { - output = output.replace(match[0], `[${match[2]}](${match[1]})`); - match = linkRegex.exec(output); - } + } - // Fix Links target black - const linkTargetRegex = /([^<]+)<\/a>/g; + // Fix Links target black + const linkTargetRegex = /([^<]+)<\/a>/g; + match = linkTargetRegex.exec(output); + while (match != null) { + output = output.replace(match[0], `[${match[2]}](${match[1]})`); match = linkTargetRegex.exec(output); - while (match != null) { - output = output.replace(match[0], `[${match[2]}](${match[1]})`); - match = linkTargetRegex.exec(output); - } + } - // Fix font color - const fontRegex = /([^<]+)<\/font>/g; + // Fix font color + const fontRegex = /([^<]+)<\/font>/g; + match = fontRegex.exec(output); + while (match != null) { + output = output.replace(match[0], match[2]); match = fontRegex.exec(output); - while (match != null) { - output = output.replace(match[0], match[2]); - match = fontRegex.exec(output); - } + } - return output; + return output; } -bot.start(); \ No newline at end of file +bot.start(); diff --git a/package-lock.json b/package-lock.json index e6a30f1..85a4ed9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "dotenv": "^16.3.1", "fs": "^0.0.1-security", "js-yaml": "^4.1.0", - "lemmy-bot": "^0.4.5", + "lemmy-bot": "^0.5.1", "rss-parser": "^3.13.0", "sqlite3": "^5.1.6" } @@ -568,19 +568,22 @@ } }, "node_modules/lemmy-bot": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/lemmy-bot/-/lemmy-bot-0.4.5.tgz", - "integrity": "sha512-GDf/Qjeig3RcjFgYAlUwsA3/YmOgKZOK0vs15KaPDNjMno+l9JZsb0I7XUuIMCPAHZUlSdSBuS9kLJzE9LouAA==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/lemmy-bot/-/lemmy-bot-0.5.1.tgz", + "integrity": "sha512-dRguH3qHLHRdnZzZ5MvguVy94k8rz/COvF+KJGkn0OOx/Qhzp/ByDv9vXZh0x9rzkddfVp4ODPZCgEDrDPbJog==", "dependencies": { - "lemmy-js-client": "0.18.3-rc.1", - "node-cron": "^3.0.2", + "lemmy-js-client": "0.19.0", + "node-cron": "^3.0.3", "sqlite3": "^5.1.6" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/lemmy-js-client": { - "version": "0.18.3-rc.1", - "resolved": "https://registry.npmjs.org/lemmy-js-client/-/lemmy-js-client-0.18.3-rc.1.tgz", - "integrity": "sha512-z+ZqPoeJClxh3oQiD7ICgkrLKwFZvxs07a/28rvCouVu5zbhjGu0xXltq0GpgtzqFsGamXZ3tYz66ryzYjPBxg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/lemmy-js-client/-/lemmy-js-client-0.19.0.tgz", + "integrity": "sha512-h+E8wC9RKjlToWw9+kuGFAzk4Fiaf61KqAwzvoCDAfj2L1r+YNt5EDMOggGCoRx5PlqLuIVr7BNEU46KxJfmHA==", "dependencies": { "cross-fetch": "^3.1.5", "form-data": "^4.0.0" @@ -795,9 +798,9 @@ "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" }, "node_modules/node-cron": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.2.tgz", - "integrity": "sha512-iP8l0yGlNpE0e6q1o185yOApANRe47UPbLf4YxfbiNHt/RU5eBcGB/e0oudruheSf+LQeDMezqC5BVAb5wwRcQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.3.tgz", + "integrity": "sha512-dOal67//nohNgYWb+nWmg5dkFdIwDm8EpeGYMekPMrngV3637lqnX0lbUcCtgibHTz6SEz7DAIjKvKDFYCnO1A==", "dependencies": { "uuid": "8.3.2" }, @@ -1749,19 +1752,19 @@ } }, "lemmy-bot": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/lemmy-bot/-/lemmy-bot-0.4.5.tgz", - "integrity": "sha512-GDf/Qjeig3RcjFgYAlUwsA3/YmOgKZOK0vs15KaPDNjMno+l9JZsb0I7XUuIMCPAHZUlSdSBuS9kLJzE9LouAA==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/lemmy-bot/-/lemmy-bot-0.5.1.tgz", + "integrity": "sha512-dRguH3qHLHRdnZzZ5MvguVy94k8rz/COvF+KJGkn0OOx/Qhzp/ByDv9vXZh0x9rzkddfVp4ODPZCgEDrDPbJog==", "requires": { - "lemmy-js-client": "0.18.3-rc.1", - "node-cron": "^3.0.2", + "lemmy-js-client": "0.19.0", + "node-cron": "^3.0.3", "sqlite3": "^5.1.6" } }, "lemmy-js-client": { - "version": "0.18.3-rc.1", - "resolved": "https://registry.npmjs.org/lemmy-js-client/-/lemmy-js-client-0.18.3-rc.1.tgz", - "integrity": "sha512-z+ZqPoeJClxh3oQiD7ICgkrLKwFZvxs07a/28rvCouVu5zbhjGu0xXltq0GpgtzqFsGamXZ3tYz66ryzYjPBxg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/lemmy-js-client/-/lemmy-js-client-0.19.0.tgz", + "integrity": "sha512-h+E8wC9RKjlToWw9+kuGFAzk4Fiaf61KqAwzvoCDAfj2L1r+YNt5EDMOggGCoRx5PlqLuIVr7BNEU46KxJfmHA==", "requires": { "cross-fetch": "^3.1.5", "form-data": "^4.0.0" @@ -1922,9 +1925,9 @@ "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" }, "node-cron": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.2.tgz", - "integrity": "sha512-iP8l0yGlNpE0e6q1o185yOApANRe47UPbLf4YxfbiNHt/RU5eBcGB/e0oudruheSf+LQeDMezqC5BVAb5wwRcQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.3.tgz", + "integrity": "sha512-dOal67//nohNgYWb+nWmg5dkFdIwDm8EpeGYMekPMrngV3637lqnX0lbUcCtgibHTz6SEz7DAIjKvKDFYCnO1A==", "requires": { "uuid": "8.3.2" } diff --git a/package.json b/package.json index a2befb3..e40bb99 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dotenv": "^16.3.1", "fs": "^0.0.1-security", "js-yaml": "^4.1.0", - "lemmy-bot": "^0.4.5", + "lemmy-bot": "^0.5.1", "rss-parser": "^3.13.0", "sqlite3": "^5.1.6" },