fix: return types [] => Collection

This commit is contained in:
Skillz4Killz
2021-04-13 17:53:49 +00:00
committed by GitHub
parent f8d6a74948
commit c2f2afb211
8 changed files with 91 additions and 34 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ import { cacheHandlers } from "../../cache.ts";
import { rest } from "../../rest/rest.ts";
import { Emoji } from "../../types/emojis/emoji.ts";
import { Errors } from "../../types/misc/errors.ts";
import { Collection } from "../../util/collection.ts";
import { endpoints } from "../../util/constants.ts";
/**
@@ -29,5 +30,5 @@ export async function getEmojis(guildId: string, addToCache = true) {
cacheHandlers.set("guilds", guildId, guild);
}
return result;
return new Collection(result.map(e => [e.id!, e]));
}