feat(turn-init): use internal Discord channel member resolver for bootstrap (no public tool)

This commit is contained in:
2026-03-08 06:08:51 +00:00
parent 121786e6e3
commit 307235e207
5 changed files with 162 additions and 11 deletions

View File

@@ -18,7 +18,7 @@ type BeforeMessageWriteDeps = {
ensurePolicyStateLoaded: (api: OpenClawPluginApi, config: DirigentConfig) => void;
getLivePluginConfig: (api: OpenClawPluginApi, fallback: DirigentConfig) => DirigentConfig;
shouldDebugLog: (config: DirigentConfig & DebugConfig, channelId?: string) => boolean;
ensureTurnOrder: (api: OpenClawPluginApi, channelId: string) => void;
ensureTurnOrder: (api: OpenClawPluginApi, channelId: string) => Promise<void> | void;
resolveDiscordUserId: (api: OpenClawPluginApi, accountId: string) => string | undefined;
sendModeratorMessage: (
botToken: string,
@@ -137,7 +137,7 @@ export function registerBeforeMessageWriteHook(deps: BeforeMessageWriteDeps): vo
return;
}
ensureTurnOrder(api, channelId);
void ensureTurnOrder(api, channelId);
const nextSpeaker = onSpeakerDone(channelId, accountId, true);
sessionAllowed.delete(key);
sessionTurnHandled.add(key);
@@ -166,7 +166,7 @@ export function registerBeforeMessageWriteHook(deps: BeforeMessageWriteDeps): vo
}
}
} else if (hasEndSymbol) {
ensureTurnOrder(api, channelId);
void ensureTurnOrder(api, channelId);
const nextSpeaker = onSpeakerDone(channelId, accountId, false);
sessionAllowed.delete(key);
sessionTurnHandled.add(key);