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
+4 -2
View File
@@ -1,4 +1,6 @@
/* globals module */
const DEFAULT_AVATAR_MODULO = 5
module.exports = {
findMarkdownLink(absolutePath) {
// We're assuming this path isn't going to change
@@ -28,7 +30,7 @@ module.exports = {
return `https://cdn.discordapp.com/embed/avatars/${avatar}.png`
},
resolveAuthor(users, author) {
const target = users.find(user => user.identifier === author)
const target = users.find((user) => user.identifier === author)
const [name, hash] = this.splitHash(author)
const avatar = target ? target.avatar : this.getDefaultAvatar(hash)
@@ -39,6 +41,6 @@ module.exports = {
}
},
resolveAuthors(users, authors) {
return authors.map(author => this.resolveAuthor(users, author))
return authors.map((author) => this.resolveAuthor(users, author))
},
}
+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)