Suggestions

This commit is contained in:
ayntee
2020-11-14 16:36:09 +04:00
parent 2c2c2e95e4
commit 8bb9095a74
+4 -8
View File
@@ -658,15 +658,11 @@ export async function createGuildFromTemplate(
data.icon = await urlToBase64(data.icon); data.icon = await urlToBase64(data.icon);
} }
try { const guild = await RequestManager.post(
const guild: CreateGuildPayload = await RequestManager.post(
endpoints.GUILD_TEMPLATE(templateCode), endpoints.GUILD_TEMPLATE(templateCode),
data, data,
) as any; ) as Promise<CreateGuildPayload>;
return guild; return guild;
} catch (error) {
throw error;
}
} }
/** /**
@@ -768,9 +764,9 @@ export async function editGuildTemplate(
throw new Error("The description can only be in between 0-120 characters."); 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}`, `${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`,
data, data,
) as any; ) as GuildTemplate;
return structures.createTemplate(template); return structures.createTemplate(template);
} }