From 8baec3564fccac1a7743ac9de481f54e0808c0c9 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 9 Sep 2025 18:16:44 -0700 Subject: style: Use base prettier:recommended rules --- src/register.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/register.ts') diff --git a/src/register.ts b/src/register.ts index 319b054..6cd2bac 100644 --- a/src/register.ts +++ b/src/register.ts @@ -4,21 +4,21 @@ import { ROLEPLAY_COMMAND, TOP_COMMAND, type DiscordCommand, -} from './discord/commands.ts'; -import dotenv from 'dotenv'; -import process from 'node:process'; +} from "./discord/commands.ts"; +import dotenv from "dotenv"; +import process from "node:process"; -dotenv.config({ path: '.dev.vars' }); +dotenv.config({ path: ".dev.vars" }); const token = process.env.DISCORD_TOKEN; const applicationID = process.env.DISCORD_APPLICATION_ID; if (!token) - throw new Error('The DISCORD_TOKEN environment variable is required.'); + throw new Error("The DISCORD_TOKEN environment variable is required."); if (!applicationID) throw new Error( - 'The DISCORD_APPLICATION_ID environment variable is required.', + "The DISCORD_APPLICATION_ID environment variable is required.", ); const url = `https://discord.com/api/v10/applications/${applicationID}/commands`; @@ -32,21 +32,21 @@ const commands: DiscordCommand[] = [ const response = await fetch(url, { headers: { - 'Content-Type': 'application/json', + "Content-Type": "application/json", Authorization: `Bot ${token}`, }, - method: 'PUT', + method: "PUT", body: JSON.stringify(commands), }); if (response.ok) { - console.log('Registered all commands'); + console.log("Registered all commands"); const data = await response.json(); console.log(JSON.stringify(data, null, 2)); } else { - console.error('Error registering commands'); + console.error("Error registering commands"); let errorText = `Error registering commands \n ${response.url}: ${response.status} ${response.statusText}`; @@ -55,7 +55,7 @@ if (response.ok) { if (error) errorText = `${errorText} \n\n ${error}`; } catch (error) { - console.error('Error reading body from request:', error); + console.error("Error reading body from request:", error); } console.error(errorText); -- cgit v1.2.3