Compare commits

..

No commits in common. "883f701359e14cfe31cfdf84fbd2732dbace0b58" and "f61f67a37c771739f2917e5e5271bea9542f1d2c" have entirely different histories.

3 changed files with 5 additions and 11 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "kanbanmod",
"version": "1.1.1",
"version": "1.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "kanbanmod",
"version": "1.1.1",
"version": "1.1.0",
"license": "ISC",
"dependencies": {
"bhttp": "^1.2.8",

View File

@ -1,6 +1,6 @@
{
"name": "kanbanmod",
"version": "1.1.1",
"version": "1.1.0",
"description": "",
"main": "index.js",
"scripts": {

View File

@ -6,10 +6,6 @@ const bhttp = require('bhttp');
const reddit = new snoowrap(config.reddit);
function log(msg) {
console.log(`${new Date().toISOString()} ${msg}`);
}
async function getWekanActorNames() {
const wekanLoginRes = await bhttp.post(`${config.wekan.url}/users/login`, {
username: config.wekan.username,
@ -41,8 +37,6 @@ async function getWekanActorNames() {
}
async function init() {
log(`Retrieving current configuration from ${config.subreddit}`);
const automodConfig = await reddit.getSubreddit(config.subreddit).getWikiPage('config/automoderator').fetch();
const automodLines = automodConfig.content_md.split('\n');
const actorLineIndex = automodLines.findIndex((line) => line.includes(config.actorCommentKey)) + 1;
@ -61,14 +55,14 @@ async function init() {
reason: 'Synced kanban actor names',
});
log(`Sync complete, resyncing in ${config.interval} minutes, set ${newActorLine}`);
console.log(`${new Date().toISOString()} Sync complete, resyncing in ${config.interval} minutes, set ${newActorLine}`);
setTimeout(() => init(), config.interval * 60 * 1000);
return;
}
log(`Sync complete, set ${newActorLine}`);
console.log(`${new Date().toISOString()} Sync complete, set ${newActorLine}`);
}
init();