From 7a9bac2bf48652efbbc7cbe0dc704dbb2f4bcab1 Mon Sep 17 00:00:00 2001 From: vulet Date: Thu, 25 Feb 2021 11:31:55 +0800 Subject: [PATCH] fix(10grans): don't allow rain on tipbot --- commands/fediverse/makeitrain.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/fediverse/makeitrain.js b/commands/fediverse/makeitrain.js index de78019..876ba7a 100644 --- a/commands/fediverse/makeitrain.js +++ b/commands/fediverse/makeitrain.js @@ -2,7 +2,9 @@ exports.runQuery = async function (roomId, event, notice) { if (config.fediverse.tipping === false) return matrixClient.sendHtmlNotice(roomId, `Tipping is not enabled.`, `Tipping is not enabled.`); const loadingString = `Making it rain for notice: ${notice}...`; const original = await matrixClient.sendHtmlNotice(roomId, `${loadingString}`, `${loadingString}`); - const users = await fediverse.utils.getStatusMentions(notice, event, original); + const findAllUsers = await fediverse.utils.getStatusMentions(notice, event, original); + const exclude = "@10grans@fedi.cc"; + const users = users.filter(users => !exclude.includes(findAllUsers)) if (!users) return matrix.utils.editNoticeHTML(roomId, original, `No eligible users found.`); const rain = (users) => { amount = users.length * 0.00000001337 // by per user: