Files
discordeno/helpers/templates/syncGuildTemplate.ts
2022-02-11 09:49:53 +00:00

15 lines
455 B
TypeScript

import type { Template } from "../../types/templates/template.ts";
import type { Bot } from "../../bot.ts";
/**
* Syncs the template to the guild's current state.
* Requires the `MANAGE_GUILD` permission.
*/
export async function syncGuildTemplate(bot: Bot, guildId: bigint, templateCode: string) {
return await bot.rest.runMethod<Template>(
bot.rest,
"put",
`${bot.constants.endpoints.GUILD_TEMPLATES(guildId)}/${templateCode}`,
);
}