(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.
This commit is contained in:
2026-08-27 22:37:53 +08:00
parent d2a7a2598b
commit 72839e0eae
2 changed files with 0 additions and 34 deletions
-10
View File
@@ -1,13 +1,3 @@
// --- Bot Settings ---
export type Settings = {
branding?: BrandingSettings;
};
export type BrandingSettings = {
status?: string;
};
// --- Guild Configuration --- // --- Guild Configuration ---
export type Configuration = { export type Configuration = {
-24
View File
@@ -52,30 +52,6 @@ export async function init(): Promise<void> {
CREATE INDEX IF NOT EXISTS messages_channel_id_idx CREATE INDEX IF NOT EXISTS messages_channel_id_idx
ON messages (channel_id); 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<Settings> {
const [row] = await client`
SELECT config FROM settings
WHERE id = '0';
`;
return row.config as Settings;
}
export async function updateSettings(settings: Partial<Settings>): Promise<void> {
await client`
UPDATE settings
SET config = config || ${client.json(settings)}
WHERE id = '0';
`;
} }
// Guild Configuration // Guild Configuration