diff --git a/src/config/sessions/explicit-session-key-normalization.ts b/src/config/sessions/explicit-session-key-normalization.ts index 6a2bc61ea7f..c8ba4af8127 100644 --- a/src/config/sessions/explicit-session-key-normalization.ts +++ b/src/config/sessions/explicit-session-key-normalization.ts @@ -1,5 +1,5 @@ import type { MsgContext } from "../../auto-reply/templating.js"; -import { getChannelPlugin, listChannelPlugins } from "../../channels/plugins/index.js"; +import { getLoadedChannelPlugin, listChannelPlugins } from "../../channels/plugins/index.js"; import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, @@ -38,7 +38,7 @@ function resolveExplicitSessionKeyNormalizerCandidates( export function normalizeExplicitSessionKey(sessionKey: string, ctx: MsgContext): string { const normalized = normalizeLowercaseStringOrEmpty(sessionKey); for (const channelId of resolveExplicitSessionKeyNormalizerCandidates(normalized, ctx)) { - const normalize = getChannelPlugin(channelId)?.messaging?.normalizeExplicitSessionKey; + const normalize = getLoadedChannelPlugin(channelId)?.messaging?.normalizeExplicitSessionKey; const next = normalize?.({ sessionKey: normalized, ctx }); if (typeof next === "string" && next.trim()) { return normalizeLowercaseStringOrEmpty(next);