Skip to content

Commit

Permalink
fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
akpi816218 committed Sep 14, 2024
1 parent bb91dae commit f4e11a5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/commands/bday.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dotenv/config';
import {
ChatInputCommandInteraction,
EmbedBuilder,
Expand Down Expand Up @@ -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({
Expand Down
5 changes: 3 additions & 2 deletions src/commands/conf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dotenv/config';
import { BaseGuildConfig, PopulatedGuildConfig } from '../struct/database';
import {
ChannelType,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion src/events/a.getGuildConf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/interactionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
ModalSubmitInteraction,
PermissionFlagsBits,
Snowflake,
StageChannel,
StringSelectMenuInteraction,
UserContextMenuCommandInteraction,
codeBlock,
Expand All @@ -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<void> {
Expand Down

0 comments on commit f4e11a5

Please sign in to comment.