From c9f617da6dd204f6c70f2d6effe4173e2abec799 Mon Sep 17 00:00:00 2001 From: Tagadda <36127788+Tagadda@users.noreply.github.com> Date: Wed, 13 Jun 2018 15:16:30 +0200 Subject: [PATCH] ver 0.0.0.2 --- index.js | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index d7ebebf..752e912 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 8a88d4b..4a0d777 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", -- GitLab