diff --git a/package-lock.json b/package-lock.json index 2fedec3..08bbe05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "devDependencies": { "@octokit/types": "^13.5.0", "@types/cors": "^2.8.17", + "@types/dotenv": "^6.1.1", "@types/express": "^4.17.21", "@types/node-schedule": "^2.1.7", "@types/qrcode": "^1.5.5", @@ -1296,6 +1297,16 @@ "@types/node": "*" } }, + "node_modules/@types/dotenv": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@types/dotenv/-/dotenv-6.1.1.tgz", + "integrity": "sha512-ftQl3DtBvqHl9L16tpqqzA4YzCSXZfi7g8cQceTz5rOlYtk/IZbFjAv3mLOQlNIgOaylCQWQoBdDQHPgEBJPHg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/express": { "version": "4.17.21", "dev": true, diff --git a/package.json b/package.json index dded73d..7401613 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "devDependencies": { "@octokit/types": "^13.5.0", "@types/cors": "^2.8.17", + "@types/dotenv": "^6.1.1", "@types/express": "^4.17.21", "@types/node-schedule": "^2.1.7", "@types/qrcode": "^1.5.5", diff --git a/src/commands/bday.ts b/src/commands/bday.ts index 2a2e73a..cb88835 100644 --- a/src/commands/bday.ts +++ b/src/commands/bday.ts @@ -53,9 +53,7 @@ export const help = new CommandHelpEntry( ); export const execute = async (interaction: ChatInputCommandInteraction) => { - const db = await openKv(DENO_KV_URL, { - accessToken: process.env.DENO_KV_ACCESS_TOKEN! - }); + const db = await openKv(DENO_KV_URL); switch (interaction.options.getSubcommand()) { case 'register': { await interaction.deferReply({ diff --git a/src/commands/conf.ts b/src/commands/conf.ts index 87c5125..cff34f7 100644 --- a/src/commands/conf.ts +++ b/src/commands/conf.ts @@ -109,9 +109,7 @@ export const help = new CommandHelpEntry( ] ); -const db = await openKv(DENO_KV_URL, { - accessToken: process.env.DENO_KV_ACCESS_TOKEN! -}); +const db = await openKv(DENO_KV_URL); const handlers = { auditlog: async ( interaction: ChatInputCommandInteraction, diff --git a/src/events/a.getGuildConf.ts b/src/events/a.getGuildConf.ts index a9c6984..1fe8113 100644 --- a/src/events/a.getGuildConf.ts +++ b/src/events/a.getGuildConf.ts @@ -1,12 +1,9 @@ -import 'dotenv/config'; import { openKv } from '@deno/kv'; import { BaseGuildConfig } from '../struct/database'; import { Guild } from 'discord.js'; import { DENO_KV_URL, DatabaseKeys } from '../config'; -const db = await openKv(DENO_KV_URL, { - accessToken: process.env.DENO_KV_ACCESS_TOKEN! -}); +const db = await openKv(DENO_KV_URL); export async function getGuildAuditLoggingChannel(guild: Guild) { const config = await getGuildConfig(guild); diff --git a/src/interactionHandlers.ts b/src/interactionHandlers.ts index e7a0f6a..97b4227 100644 --- a/src/interactionHandlers.ts +++ b/src/interactionHandlers.ts @@ -21,9 +21,7 @@ import { logger } from './logger'; import { openKv } from '@deno/kv'; import { DENO_KV_URL, DatabaseKeys } from './config'; -const db = await openKv(DENO_KV_URL, { - accessToken: process.env.DENO_KV_ACCESS_TOKEN! -}); +const db = await openKv(DENO_KV_URL); export const InteractionHandlers = { async Button(interaction: ButtonInteraction): Promise {