chore: add return type and handle raw API payload
This commit is contained in:
parent
d1fcce7b83
commit
be662a230b
1 changed files with 6 additions and 6 deletions
|
@ -45,21 +45,21 @@ export class Template extends Base {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Modifies the template's metadata. Requires the MANAGE_GUILD permission. Returns the template object on success. */
|
/** Modifies the template's metadata. Requires the MANAGE_GUILD permission. Returns the template object on success. */
|
||||||
async edit(data: ModifyGuildTemplateParams) {
|
async edit(data: ModifyGuildTemplateParams): Promise<Template> {
|
||||||
const res = await this.client.rest.patch(TEMPLATE(this.code), data)
|
const res = await this.client.rest.patch(TEMPLATE(this.code), data)
|
||||||
return res
|
return new Template(this.client, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Deletes the template. Requires the MANAGE_GUILD permission. Returns the deleted template object on success. */
|
/** Deletes the template. Requires the MANAGE_GUILD permission. Returns the deleted template object on success. */
|
||||||
async delete() {
|
async delete(): Promise<Template> {
|
||||||
const res = await this.client.rest.delete(TEMPLATE(this.code))
|
const res = await this.client.rest.delete(TEMPLATE(this.code))
|
||||||
return res
|
return new Template(this.client, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Syncs the template to the guild's current state. Requires the MANAGE_GUILD permission. Returns the template object on success. */
|
/** Syncs the template to the guild's current state. Requires the MANAGE_GUILD permission. Returns the template object on success. */
|
||||||
async sync() {
|
async sync(): Promise<Template> {
|
||||||
const res = await this.client.rest.put(TEMPLATE(this.code))
|
const res = await this.client.rest.put(TEMPLATE(this.code))
|
||||||
return res
|
return new Template(this.client, res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue