From dd26c7a45ca0dc698a26714d4e5109719d1ee2bf Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 23 May 2021 22:10:11 -0400 Subject: [PATCH] rename openDb to openDB --- components/db.ts | 8 ++++---- index.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/db.ts b/components/db.ts index e7633f4..f6c9568 100644 --- a/components/db.ts +++ b/components/db.ts @@ -4,7 +4,7 @@ import Discord from 'discord.js' let db : Database | null = null; -export async function openDb () { +export async function openDB () { if(db == null){ db = await open({ filename: './db/bot.db', @@ -22,13 +22,13 @@ export async function testDb(message: Discord.Message, command: string, args: st await message.channel.send('no args'); return; } - await openDb().then((db) => { + await openDB().then((db) => { db.run('INSERT INTO saved_data (msg_id,data)' + 'VALUES(?,?)', [message.id, args[0]]); }); await message.channel.send('Saved ' + args[0] + ' with id ' + message.id); break; case 'dump': - await openDb().then(async (db) => { + await openDB().then(async (db) => { let flag: boolean = true; let outEmbed = new Discord.MessageEmbed() .setColor('#0099ff') @@ -53,7 +53,7 @@ export async function testDb(message: Discord.Message, command: string, args: st }); break; case 'clear': - openDb() + openDB() .then((db) => { return db.run('DELETE FROM saved_data'); }) diff --git a/index.ts b/index.ts index 28a3616..e2d2f8a 100644 --- a/index.ts +++ b/index.ts @@ -3,7 +3,7 @@ dotenv.config(); import Discord from 'discord.js'; import _ from 'lodash'; -import { openDb, testDb } from './components/db'; +import { openDB, testDb } from './components/db'; import logger from './logger'; const NOTIF_CHANNEL_ID: string = process.env.NOTIF_CHANNEL_ID || '.';