mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 03:23:29 +01:00
fix(guild): Creating a template actually creates a template (#11030)
feat(guild): add creating a template
This commit is contained in:
@@ -1287,16 +1287,16 @@ export class GuildsAPI {
|
|||||||
* Creates a new template
|
* Creates a new template
|
||||||
*
|
*
|
||||||
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
|
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
|
||||||
* @param templateCode - The code of the template
|
* @param guildId - The id of the guild
|
||||||
* @param body - The data for creating the template
|
* @param body - The data for creating the template
|
||||||
* @param options - The options for creating the template
|
* @param options - The options for creating the template
|
||||||
*/
|
*/
|
||||||
public async createTemplate(
|
public async createTemplate(
|
||||||
templateCode: string,
|
guildId: Snowflake,
|
||||||
body: RESTPostAPIGuildTemplatesJSONBody,
|
body: RESTPostAPIGuildTemplatesJSONBody,
|
||||||
{ signal }: Pick<RequestData, 'signal'> = {},
|
{ signal }: Pick<RequestData, 'signal'> = {},
|
||||||
) {
|
) {
|
||||||
return this.rest.post(Routes.template(templateCode), { body, signal }) as Promise<RESTPostAPIGuildTemplatesResult>;
|
return this.rest.post(Routes.guildTemplates(guildId), { body, signal }) as Promise<RESTPostAPIGuildTemplatesResult>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user