mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 08:20:08 +00:00
fix: cleanup some old ts-ignores
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user