Skip to content

Commit

Permalink
Update a.getGuildConf.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
akpi816218 committed Sep 14, 2024
1 parent 68ef1fd commit 075ff97
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/events/a.getGuildConf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { BaseGuildConfig } from '../struct/database';
import { Guild } from 'discord.js';
import { DENO_KV_URL, DatabaseKeys } from '../config';

const db = await openKv(DENO_KV_URL);

export async function getGuildAuditLoggingChannel(guild: Guild) {
const config = await getGuildConfig(guild);
if (!config.auditlog?.enabled || !config?.auditlog?.channel) return;
Expand All @@ -18,6 +16,7 @@ export async function getGuildGreetingData(guild: Guild) {
}

async function getGuildConfig(guild: Guild) {
const db = await openKv(DENO_KV_URL);
return (
(await db.get<BaseGuildConfig>([DatabaseKeys.GuildConfig, guild.id]))
.value ?? {}
Expand Down

0 comments on commit 075ff97

Please sign in to comment.