Reverted changes except for the file location

This commit is contained in:
WatDuhHekBro 2021-01-02 20:16:15 -06:00
parent 5537cec29a
commit f8d6c0d336
2 changed files with 7 additions and 3 deletions

View File

@ -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.

View File

@ -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;
}