From 38a8edd0305ef7713f5ccbdac6cbb99fde6a6017 Mon Sep 17 00:00:00 2001 From: NekoAria Date: Mon, 11 Nov 2024 11:49:41 +0800 Subject: [PATCH] fix(route/discord): add missing `__dirname` definition in search route --- lib/routes/discord/search.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/routes/discord/search.ts b/lib/routes/discord/search.ts index 633539f7d0a390..5e36f35d865bf2 100644 --- a/lib/routes/discord/search.ts +++ b/lib/routes/discord/search.ts @@ -3,6 +3,7 @@ import path from 'node:path'; import { config } from '@/config'; import InvalidParameterError from '@/errors/types/invalid-parameter'; import { Route } from '@/types'; +import { getCurrentPath } from '@/utils/helpers'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import ConfigNotFoundError from '@/errors/types/config-not-found'; @@ -10,6 +11,8 @@ import { queryToBoolean } from '@/utils/readable-social'; import { baseUrl, getGuild, searchGuildMessages, SearchGuildMessagesParams, HasType, VALID_HAS_TYPES } from './discord-api'; +const __dirname = getCurrentPath(import.meta.url); + export const route: Route = { path: '/search/:guildId/:routeParams', categories: ['social-media'],