fix: cleanup some old ts-ignores

This commit is contained in:
Skillz4Killz
2022-03-21 12:20:31 +00:00
committed by GitHub
parent fe42864b00
commit efeec03354
8 changed files with 8 additions and 16 deletions

View File

@@ -10,7 +10,7 @@ import {
DiscordReady,
DiscordUnavailableGuild,
} from "../types/discord.ts";
import { GatewayOpcodes } from "../types/shared.ts";
import { GatewayEventNames, GatewayOpcodes } from "../types/shared.ts";
/** Handler for handling every message event from websocket. */
// deno-lint-ignore no-explicit-any
@@ -134,8 +134,7 @@ export async function handleOnMessage(gateway: GatewayManager, message: any, sha
// GUILD WAS MARKED LOADING IN READY EVENT, THIS WAS THE FIRST GUILD_CREATE TO ARRIVE
if (gateway.cache.loadingGuildIds.has(id)) {
// @ts-ignore override with a custom event
messageData.t = "GUILD_LOADED_DD";
messageData.t = "GUILD_LOADED_DD" as GatewayEventNames;
gateway.cache.loadingGuildIds.delete(id);
}

View File

@@ -5,7 +5,6 @@ import { Optionalize } from "../types/shared.ts";
export function transformAuditlogEntry(bot: Bot, payload: DiscordAuditLogEntry) {
const auditlogEntry = {
id: bot.transformers.snowflake(payload.id),
// @ts-ignore TODO FIX THIS
changes: payload.changes?.map((change) => {
switch (change.key) {
case "$add":

View File

@@ -51,9 +51,8 @@ export class EmojiToggles extends ToggleBitfield {
/** Lists all the toggles for the role and whether or not each is true or false. */
list() {
const json = {};
const json: Record<string, boolean> = {};
for (const [key, value] of Object.entries(EmojiToggle)) {
// @ts-ignore
json[key] = super.contains(value);
}

View File

@@ -228,9 +228,8 @@ export class GuildToggles extends ToggleBitfieldBigint {
/** Lists all the toggles for the role and whether or not each is true or false. */
list() {
const json = {};
const json: Record<string, boolean> = {};
for (const [key, value] of Object.entries(GuildToggle)) {
// @ts-ignore
json[key] = super.contains(value);
}

View File

@@ -43,9 +43,8 @@ export class MemberToggles extends ToggleBitfield {
/** Lists all the toggles for the role and whether or not each is true or false. */
list() {
const json = {};
const json: Record<string, boolean> = {};
for (const [key, value] of Object.entries(MemberToggle)) {
// @ts-ignore
json[key] = super.contains(value);
}

View File

@@ -43,9 +43,8 @@ export class RoleToggles extends ToggleBitfield {
/** Lists all the toggles for the role and whether or not each is true or false. */
list() {
const json = {};
const json: Record<string, boolean> = {};
for (const [key, value] of Object.entries(RoleToggle)) {
// @ts-ignore
json[key] = super.contains(value);
}

View File

@@ -51,9 +51,8 @@ export class UserToggles extends ToggleBitfield {
/** Lists all the toggles for the role and whether or not each is true or false. */
list() {
const json = {};
const json: Record<string, boolean> = {};
for (const [key, value] of Object.entries(UserToggle)) {
// @ts-ignore
json[key] = super.contains(value);
}

View File

@@ -75,9 +75,8 @@ export class VoiceStateToggles extends ToggleBitfield {
/** Lists all the toggles for the role and whether or not each is true or false. */
list() {
const json = {};
const json: Record<string, boolean> = {};
for (const [key, value] of Object.entries(VoiceStateToggle)) {
// @ts-ignore
json[key] = super.contains(value);
}