From 72839e0eae0a6148e00995a914e9709ce08f2508 Mon Sep 17 00:00:00 2001 From: Nix Krystik Date: Thu, 27 Aug 2026 22:37:53 +0800 Subject: [PATCH] (database): removing bot settings temporarily, as it isn't being implemented until majority of the bot has been written. This may require being handled differently. My current considerations are storing as a `.json` or `.ts` file. These options both integrate directly in JavaScript and may be handled in memory, rather than being called through the database. Storing the settings under the '0' identifier is still a valid (and the leading) option. --- src/types/settings.d.ts | 10 ---------- src/utils/database.ts | 24 ------------------------ 2 files changed, 34 deletions(-) diff --git a/src/types/settings.d.ts b/src/types/settings.d.ts index 48af7a6..043c646 100644 --- a/src/types/settings.d.ts +++ b/src/types/settings.d.ts @@ -1,13 +1,3 @@ -// --- Bot Settings --- - -export type Settings = { - branding?: BrandingSettings; -}; - -export type BrandingSettings = { - status?: string; -}; - // --- Guild Configuration --- export type Configuration = { diff --git a/src/utils/database.ts b/src/utils/database.ts index 1d70a90..66f3b35 100644 --- a/src/utils/database.ts +++ b/src/utils/database.ts @@ -52,30 +52,6 @@ export async function init(): Promise { CREATE INDEX IF NOT EXISTS messages_channel_id_idx ON messages (channel_id); `; - - // Ensure global bot settings exist. - await client` - INSERT INTO settings (id, config) - VALUES (0, '{}'::jsonb) - ON CONFLICT (id) DO NOTHING; - `; -} - -export async function getSettings(): Promise { - const [row] = await client` - SELECT config FROM settings - WHERE id = '0'; - `; - - return row.config as Settings; -} - -export async function updateSettings(settings: Partial): Promise { - await client` - UPDATE settings - SET config = config || ${client.json(settings)} - WHERE id = '0'; - `; } // Guild Configuration