From b5500ae18ed06841e9e45042f0c76c9006d94fd8 Mon Sep 17 00:00:00 2001 From: Tagadda <36127788+Tagadda@users.noreply.github.com> Date: Fri, 15 Jun 2018 06:45:36 +0200 Subject: [PATCH] Unfollow everybody from an instance when blockdomain --- commands/BlockDomain.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/commands/BlockDomain.js b/commands/BlockDomain.js index 1a9753e..e9c0d2d 100644 --- a/commands/BlockDomain.js +++ b/commands/BlockDomain.js @@ -11,6 +11,15 @@ class BlockDomain extends CommandBase { execute(msg, args) { this.client.block_domain(args[0]); + this.client.following_list().then((result) => { + for (const account of result) { + if (account.acct.split('@')[1] === args[0]) { + this.client.unfollow(account.id); + console.log("UNFOLLOW: " + account.acct); + } + } + }); + this.client.fav(msg.status.id); } } -- GitLab