chore: deno fmt

This commit is contained in:
Skillz4Killz
2021-04-04 00:34:40 +00:00
committed by GitHub
parent e7d9b58c81
commit b81bf8d484
24 changed files with 140 additions and 155 deletions
@@ -23,12 +23,11 @@ export async function createGuildTemplate(
throw new Error("The description can only be in between 0-120 characters.");
}
const template =
(await rest.runMethod(
"post",
endpoints.GUILD_TEMPLATES(guildId),
data,
)) as GuildTemplate;
const template = (await rest.runMethod(
"post",
endpoints.GUILD_TEMPLATES(guildId),
data,
)) as GuildTemplate;
return structures.createTemplateStruct(template);
}
@@ -13,11 +13,10 @@ export async function deleteGuildTemplate(
) {
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
const deletedTemplate =
(await rest.runMethod(
"delete",
`${endpoints.GUILD_TEMPLATES(guildId)}/${templateCode}`,
)) as GuildTemplate;
const deletedTemplate = (await rest.runMethod(
"delete",
`${endpoints.GUILD_TEMPLATES(guildId)}/${templateCode}`,
)) as GuildTemplate;
return structures.createTemplateStruct(deletedTemplate);
}
+5 -6
View File
@@ -22,12 +22,11 @@ export async function editGuildTemplate(
throw new Error("The description can only be in between 0-120 characters.");
}
const template =
(await rest.runMethod(
"patch",
`${endpoints.GUILD_TEMPLATES(guildId)}/${templateCode}`,
data,
)) as GuildTemplate;
const template = (await rest.runMethod(
"patch",
`${endpoints.GUILD_TEMPLATES(guildId)}/${templateCode}`,
data,
)) as GuildTemplate;
return structures.createTemplateStruct(template);
}
+4 -5
View File
@@ -10,11 +10,10 @@ import { requireBotGuildPermissions } from "../../util/permissions.ts";
export async function getGuildTemplates(guildId: string) {
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
const templates =
(await rest.runMethod(
"get",
endpoints.GUILD_TEMPLATES(guildId),
)) as GuildTemplate[];
const templates = (await rest.runMethod(
"get",
endpoints.GUILD_TEMPLATES(guildId),
)) as GuildTemplate[];
return templates.map((template) => structures.createTemplateStruct(template));
}
+4 -5
View File
@@ -4,11 +4,10 @@ import { endpoints } from "../../util/constants.ts";
/** Returns the guild template if it exists */
export async function getTemplate(templateCode: string) {
const result =
(await rest.runMethod(
"get",
endpoints.GUILD_TEMPLATE(templateCode),
) as GuildTemplate);
const result = (await rest.runMethod(
"get",
endpoints.GUILD_TEMPLATE(templateCode),
) as GuildTemplate);
const template = await structures.createTemplateStruct(result);
return template;
+4 -5
View File
@@ -10,11 +10,10 @@ import { requireBotGuildPermissions } from "../../util/permissions.ts";
export async function syncGuildTemplate(guildId: string, templateCode: string) {
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
const template =
(await rest.runMethod(
"put",
`${endpoints.GUILD_TEMPLATES(guildId)}/${templateCode}`,
)) as GuildTemplate;
const template = (await rest.runMethod(
"put",
`${endpoints.GUILD_TEMPLATES(guildId)}/${templateCode}`,
)) as GuildTemplate;
return structures.createTemplateStruct(template);
}