import Surreal from "https://deno.land/x/surrealdb@v0.5.0/mod.ts"; import config from "./config.ts"; import { GoofyAhhException } from "./bot.ts"; export const db = new Surreal(`${config.general.db.url}/rpc`); export interface Channel { moduleName: string; name: string; description: string; history: { name: string; content: string; }[]; } export default async function init() { try { await db.signin({ user: config.general.db.user, pass: config.general.db.pass, }); await db.use(config.general.db.namespace, config.general.db.database); } catch (e) { throw new GoofyAhhException(e); } }