From 8bb9095a748bb2c7f9e48fa290e5954435e7c118 Mon Sep 17 00:00:00 2001 From: ayntee Date: Sat, 14 Nov 2020 16:36:09 +0400 Subject: [PATCH] Suggestions --- src/handlers/guild.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/handlers/guild.ts b/src/handlers/guild.ts index d7e9763d2..bcc8f60a6 100644 --- a/src/handlers/guild.ts +++ b/src/handlers/guild.ts @@ -658,15 +658,11 @@ export async function createGuildFromTemplate( data.icon = await urlToBase64(data.icon); } - try { - const guild: CreateGuildPayload = await RequestManager.post( - endpoints.GUILD_TEMPLATE(templateCode), - data, - ) as any; - return guild; - } catch (error) { - throw error; - } + const guild = await RequestManager.post( + endpoints.GUILD_TEMPLATE(templateCode), + data, + ) as Promise; + return guild; } /** @@ -768,9 +764,9 @@ export async function editGuildTemplate( throw new Error("The description can only be in between 0-120 characters."); } - const template: GuildTemplate = await RequestManager.patch( + const template = await RequestManager.patch( `${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`, data, - ) as any; + ) as GuildTemplate; return structures.createTemplate(template); }