From f4e11a55a5262139527ff47bd8c8e24a357bf62b Mon Sep 17 00:00:00 2001 From: akpi816218 Date: Fri, 13 Sep 2024 19:26:02 -0700 Subject: [PATCH] fix? --- src/commands/bday.ts | 5 +++-- src/commands/conf.ts | 5 +++-- src/events/a.getGuildConf.ts | 4 +++- src/interactionHandlers.ts | 5 +++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/commands/bday.ts b/src/commands/bday.ts index ccc1420..2a2e73a 100644 --- a/src/commands/bday.ts +++ b/src/commands/bday.ts @@ -1,4 +1,3 @@ -import 'dotenv/config'; import { ChatInputCommandInteraction, EmbedBuilder, @@ -54,7 +53,9 @@ export const help = new CommandHelpEntry( ); export const execute = async (interaction: ChatInputCommandInteraction) => { - const db = await openKv(DENO_KV_URL); + const db = await openKv(DENO_KV_URL, { + accessToken: process.env.DENO_KV_ACCESS_TOKEN! + }); switch (interaction.options.getSubcommand()) { case 'register': { await interaction.deferReply({ diff --git a/src/commands/conf.ts b/src/commands/conf.ts index fb885fd..87c5125 100644 --- a/src/commands/conf.ts +++ b/src/commands/conf.ts @@ -1,4 +1,3 @@ -import 'dotenv/config'; import { BaseGuildConfig, PopulatedGuildConfig } from '../struct/database'; import { ChannelType, @@ -110,7 +109,9 @@ export const help = new CommandHelpEntry( ] ); -const db = await openKv(DENO_KV_URL); +const db = await openKv(DENO_KV_URL, { + accessToken: process.env.DENO_KV_ACCESS_TOKEN! +}); const handlers = { auditlog: async ( interaction: ChatInputCommandInteraction, diff --git a/src/events/a.getGuildConf.ts b/src/events/a.getGuildConf.ts index 5c1b17b..a9c6984 100644 --- a/src/events/a.getGuildConf.ts +++ b/src/events/a.getGuildConf.ts @@ -4,7 +4,9 @@ import { BaseGuildConfig } from '../struct/database'; import { Guild } from 'discord.js'; import { DENO_KV_URL, DatabaseKeys } from '../config'; -const db = await openKv(DENO_KV_URL); +const db = await openKv(DENO_KV_URL, { + accessToken: process.env.DENO_KV_ACCESS_TOKEN! +}); export async function getGuildAuditLoggingChannel(guild: Guild) { const config = await getGuildConfig(guild); diff --git a/src/interactionHandlers.ts b/src/interactionHandlers.ts index a76027d..e7a0f6a 100644 --- a/src/interactionHandlers.ts +++ b/src/interactionHandlers.ts @@ -9,7 +9,6 @@ import { ModalSubmitInteraction, PermissionFlagsBits, Snowflake, - StageChannel, StringSelectMenuInteraction, UserContextMenuCommandInteraction, codeBlock, @@ -22,7 +21,9 @@ import { logger } from './logger'; import { openKv } from '@deno/kv'; import { DENO_KV_URL, DatabaseKeys } from './config'; -const db = await openKv(DENO_KV_URL); +const db = await openKv(DENO_KV_URL, { + accessToken: process.env.DENO_KV_ACCESS_TOKEN! +}); export const InteractionHandlers = { async Button(interaction: ButtonInteraction): Promise {