From 23a4c0f864e91f99bf2a7cdcc82bbe22ecc72f93 Mon Sep 17 00:00:00 2001 From: ITOH <72305210+itohatweb@users.noreply.github.com> Date: Thu, 15 Apr 2021 18:09:40 +0200 Subject: [PATCH] removed templatestruct --- .../templates/create_guild_template.ts | 8 +-- .../templates/delete_guild_template.ts | 10 ++-- src/helpers/templates/edit_guild_template.ts | 10 ++-- src/helpers/templates/get_guild_templates.ts | 8 +-- src/helpers/templates/get_template.ts | 11 ++-- src/helpers/templates/sync_guild_template.ts | 10 ++-- src/structures/mod.ts | 2 - src/structures/template.ts | 53 ------------------- 8 files changed, 28 insertions(+), 84 deletions(-) delete mode 100644 src/structures/template.ts diff --git a/src/helpers/templates/create_guild_template.ts b/src/helpers/templates/create_guild_template.ts index bcb02f290..6bc726bbe 100644 --- a/src/helpers/templates/create_guild_template.ts +++ b/src/helpers/templates/create_guild_template.ts @@ -1,8 +1,8 @@ import { rest } from "../../rest/rest.ts"; -import { structures } from "../../structures/mod.ts"; import { DiscordTemplate, Template } from "../../types/templates/template.ts"; import { endpoints } from "../../util/constants.ts"; import { requireBotGuildPermissions } from "../../util/permissions.ts"; +import { snakeKeysToCamelCase } from "../../util/utils.ts"; /** * Creates a template for the guild. @@ -24,11 +24,11 @@ export async function createGuildTemplate( throw new Error("The description can only be in between 0-120 characters."); } - const template = (await rest.runMethod( + const template = await rest.runMethod( "post", endpoints.GUILD_TEMPLATES(guildId), data, - )) as DiscordTemplate; + ); - return structures.createTemplateStruct(template); + return snakeKeysToCamelCase