mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Update supporters formatting in !about
This commit is contained in:
parent
dd22745ae0
commit
d57d563761
1 changed files with 10 additions and 7 deletions
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue