diff --git a/src/api.ts b/src/api.ts index 8ad0e77..cbc7fe9 100644 --- a/src/api.ts +++ b/src/api.ts @@ -93,9 +93,9 @@ function readHTML(html: string): uniteApiData { }; //filter down to just ones named "og:..." - metaElems = metaElems.filter(el => el.attribs.property?.startsWith('og:')); + metaElems = metaElems.filter((el: cheerio.Element) => el.attribs.property?.startsWith('og:')); - metaElems.forEach(el => { + metaElems.forEach((el: cheerio.Element) => { let attr = el.attribs; if (attr.property === 'og:title') { @@ -107,7 +107,7 @@ function readHTML(html: string): uniteApiData { } else if (attr.property === 'og:description') { //all lines - let lines = attr.content.split('\n').map(l => l.trim()), + let lines = attr.content.split('\n').map((l: string) => l.trim()), extraLines: string[] = []; //ensure first line is correct @@ -162,9 +162,9 @@ function readHTML(html: string): uniteApiData { lines.shift(); //rest of lines - lines.forEach(line => { + lines.forEach((line: string) => { - let split = line.split(':').map(l => l.trim()), + let split = line.split(':').map((l: string) => l.trim()), key = split[0].toLowerCase().replace(/[^\w]/g, ''), value = split[1]; diff --git a/src/discord.ts b/src/discord.ts index 696af3f..6e59150 100644 --- a/src/discord.ts +++ b/src/discord.ts @@ -45,8 +45,8 @@ const commands = [ } ] } -], - commandNames = commands.map(c => c.name); +]/*, + commandNames = commands.map(c => c.name);*/ /** * register/reload commands on guild(s) diff --git a/src/queue.ts b/src/queue.ts index 773e988..1dcbd41 100644 --- a/src/queue.ts +++ b/src/queue.ts @@ -3,7 +3,7 @@ join message should contain your current position in the queue, editing it to keep it current */ -import { Client, CommandInteraction, GuildMember, MessageEmbed, TextChannel } from "discord.js"; +import { Client, CommandInteraction, MessageEmbed, TextChannel } from "discord.js"; import * as fs from 'fs'; import { emsg, getChannel, getMember, memberIsModThrow, queueInfo, queueInfoBase } from "./util"; import { Lang } from './lang'; @@ -75,18 +75,6 @@ namespace Queue { } } - export function addPlayer(channelId: string, member: GuildMember) { - if (QUEUE.has(channelId)) { - QUEUE.delete(channelId); - } - } - - export function removePlayer(channelId: string, member: GuildMember) { - if (QUEUE.has(channelId)) { - QUEUE.delete(channelId); - } - } - } SaveQueue(); diff --git a/tsconfig.json b/tsconfig.json index 1e9efb6..b00c853 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,10 @@ "outDir": "./dist", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, + "skipLibCheck": true, "strict": true, - "skipLibCheck": true + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, } }