From d57d563761ffc01b5a2c7de653b7b497dbff95cd Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Fri, 20 Aug 2021 20:43:08 +0300 Subject: [PATCH] Update supporters formatting in !about --- .../src/plugins/Utility/commands/AboutCmd.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/backend/src/plugins/Utility/commands/AboutCmd.ts b/backend/src/plugins/Utility/commands/AboutCmd.ts index 0d6f8493..5858d369 100644 --- a/backend/src/plugins/Utility/commands/AboutCmd.ts +++ b/backend/src/plugins/Utility/commands/AboutCmd.ts @@ -7,6 +7,7 @@ import { getCurrentUptime } from "../../../uptime"; import { multiSorter, resolveMember, sorter } from "../../../utils"; import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin"; import { utilityCmd } from "../types"; +import { shuffle } from "lodash"; export const AboutCmd = utilityCmd({ trigger: "about", @@ -80,17 +81,19 @@ export const AboutCmd = utilityCmd({ }; const supporters = await pluginData.state.supporters.getAll(); - supporters.sort( - multiSorter([ - [r => r.amount, "DESC"], - [r => r.name.toLowerCase(), "ASC"], - ]), - ); + const shuffledSupporters = shuffle(supporters); if (supporters.length) { + const formattedSupporters = shuffledSupporters + // Bold every other supporter to make them easy to recognize from each other + .map((s, i) => (i % 2 === 0 ? `**${s.name}**` : `__${s.name}__`)) + .join(" "); + aboutContent.embeds![0].fields!.push({ name: "Zeppelin supporters 🎉", - value: supporters.map(s => `**${s.name}** ${s.amount ? `${s.amount}€/mo` : ""}`.trim()).join("\n"), + value: + "These amazing people have supported Zeppelin development by pledging on [Patreon](https://www.patreon.com/zeppelinbot):\n\n" + + formattedSupporters, inline: false, }); }