mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
Suggestions
This commit is contained in:
+7
-11
@@ -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 Promise<CreateGuildPayload>;
|
||||||
) as any;
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user