Adds eslint and linted & improved routing for interactions

This commit is contained in:
Michel Fedde 2025-06-17 20:37:53 +02:00
parent 83209f642c
commit 441715675c
35 changed files with 2091 additions and 463 deletions

View file

@ -1,5 +1,6 @@
import {formatEmoji, Routes, Snowflake} from "discord.js";
import {DiscordClient} from "../Discord/DiscordClient";
import {Nullable} from "../types/Nullable";
export class IconCache {
private existingIcons: Map<string, string> | undefined;
@ -22,7 +23,7 @@ export class IconCache {
const id = this.get(iconName);
return formatEmoji({
id: id,
id,
name: iconName
});
}
@ -47,10 +48,14 @@ export class IconCache {
return;
}
const existingEmojis: DiscordIconRequest = await this.client.RESTClient.get(
const existingEmojis: Nullable<DiscordIconRequest> = await this.client.RESTClient.get(
Routes.applicationEmojis(this.client.ApplicationId)
)
if (!existingEmojis) {
return;
}
this.existingIcons = new Map<string, string>(
existingEmojis.items.map((item) => {
return [ item.name, item.id ]