diff --git a/src/core/lib.ts b/src/core/lib.ts index 7a12538..0c44fbc 100644 --- a/src/core/lib.ts +++ b/src/core/lib.ts @@ -162,22 +162,24 @@ export function botHasPermission(guild: Guild | null, permission: number): boole } export function updateGlobalEmoteRegistry(): void { - const list: EmoteRegistryDumpEntry[] = []; + const data: EmoteRegistryDump = {version: 1, list: []}; for (const guild of client.guilds.cache.values()) { for (const emote of guild.emojis.cache.values()) { - list.push({ + data.list.push({ + ref: emote.name, id: emote.id, name: emote.name, requires_colons: emote.requiresColons || false, animated: emote.animated, url: emote.url, + guild_id: emote.guild.name, guild_name: emote.guild.name }); } } - FileManager.write("emote-registry", {version: 1, list}, true); + FileManager.write("emote-registry", data, true); } // Pagination function that allows for customization via a callback. diff --git a/src/core/structures.ts b/src/core/structures.ts index a921931..0d78e13 100644 --- a/src/core/structures.ts +++ b/src/core/structures.ts @@ -108,11 +108,13 @@ export function getPrefix(guild: DiscordGuild | null): string { } export interface EmoteRegistryDumpEntry { + ref: string; id: Snowflake; name: string; requires_colons: boolean; animated: boolean; url: string; + guild_id: Snowflake; guild_name: string; }