chore(lint): small clean up of lint errors wip on #312

This commit is contained in:
Jean-Philippe Sirois
2020-08-26 19:39:27 -04:00
parent c2d58941c5
commit 2a974cc598
24 changed files with 61 additions and 40 deletions
+3 -5
View File
@@ -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)