mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
fix: return types [] => Collection
This commit is contained in:
@@ -3,6 +3,7 @@ import { structures } from "../../structures/mod.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
||||
import { DiscordTemplate } from "../../types/templates/template.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
|
||||
/**
|
||||
* Returns an array of templates.
|
||||
@@ -13,8 +14,13 @@ export async function getGuildTemplates(guildId: string) {
|
||||
|
||||
const templates = (await rest.runMethod(
|
||||
"get",
|
||||
endpoints.GUILD_TEMPLATES(guildId),
|
||||
endpoints.GUILD_TEMPLATES(guildId)
|
||||
)) as DiscordTemplate[];
|
||||
|
||||
return templates.map((template) => structures.createTemplateStruct(template));
|
||||
return new Collection(
|
||||
templates.map((template) => [
|
||||
template.code,
|
||||
structures.createTemplateStruct(template),
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user