diff --git a/index.js b/index.js index d7ebebfa338055b6896c7829c92d7896c861a15f..752e9120d2c567435623eb6ef9383ef10d5cd56d 100644 --- a/index.js +++ b/index.js @@ -3,11 +3,13 @@ const striptags = require('striptags'); const fs = require('fs'); const config = require('./config.json'); -// Hardcode admins since Mastodon API doesn't provide such thing... +// Init +const client = new Bot(config, [{api_point: "public", events: ["update"]}, + {api_point: "user", events: ["notification"]}]); + const admins = new Set(config.admins); -const client = new Bot(config, [{api_point: "public", events: ["update"]}, - {api_point: "user", events: ["notification"]}]); +const following = new Set(); const commands = new Map(); const commandFiles = fs.readdirSync(__dirname + "/commands/"); @@ -17,9 +19,7 @@ for (const file of commandFiles) { commands.set(command.name, command) } -// Following list -const following = new Set(); - +// Start the bot and populate following client.start().then(() => { client.following_list().then((result) => { for(const account of result) { diff --git a/package.json b/package.json index 8a88d4b7e59768b8cb8bebf5825b39134314b86e..4a0d7770948d13c32f3d45150f2d6d8b53304012 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "federationbot", - "version": "0.0.1", + "version": "0.0.2", "dependencies": { "mastodon-api": "^1.3.0", "striptags": "^3.1.1",