mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
chore(lint): small clean up of lint errors wip on #312
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
/* globals require, process, console */
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
// This script will be ran periodically through CI
|
||||
// don't touch it
|
||||
const Discord = require("discord.js")
|
||||
@@ -22,27 +24,23 @@ const writeS = (content, dest) => {
|
||||
}
|
||||
|
||||
client.once("ready", async () => {
|
||||
// tslint:disable-next-line no-console
|
||||
console.log("Bot ready, fetching user list...")
|
||||
const tph = client.guilds.cache.get(TPH)
|
||||
if (!tph) {
|
||||
throw Error("Bot is not in TPH, cannot fetch users")
|
||||
}
|
||||
const members = await tph.members.fetch()
|
||||
const memberInfo = members.map(member => ({
|
||||
const memberInfo = members.map((member) => ({
|
||||
avatar: member.user.displayAvatarURL(),
|
||||
identifier: member.user.tag,
|
||||
}))
|
||||
const wrs = fs.createWriteStream(DESTINATION)
|
||||
// tslint:disable-next-line no-console
|
||||
console.log(`Fetched ${memberInfo.length} users, writing to ${DESTINATION}`)
|
||||
writeS(memberInfo, wrs).on("finish", () => {
|
||||
// tslint:disable-next-line no-console
|
||||
console.log("Finished writing list")
|
||||
process.exit(0)
|
||||
})
|
||||
})
|
||||
|
||||
// tslint:disable-next-line no-console
|
||||
console.log("Attempting to log in...")
|
||||
client.login(BOT_TOKEN)
|
||||
|
||||
Reference in New Issue
Block a user