This commit is contained in:
Kalle (Sendou)
2021-03-09 13:00:58 +02:00
parent 497d86d196
commit e3ab352e5e
4 changed files with 89 additions and 29 deletions

View File

@@ -0,0 +1,30 @@
import fs from "fs";
import path from "path";
import prisma from "../client";
const main = async () => {
const patrons = await prisma.user.findMany({
where: { patreonTier: { not: null } },
orderBy: { patreonTier: "desc" },
select: {
username: true,
discriminator: true,
patreonTier: true,
discordId: true,
},
});
fs.writeFile(
path.resolve(__dirname, "..", "..", "utils", "data", "patrons.json"),
JSON.stringify(patrons),
function (err) {
if (err) throw err;
}
);
};
main()
.catch((e) => console.error(e))
.finally(async () => {
await prisma.$disconnect();
});