mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-05 18:52:57 +00:00
33 lines
1011 B
TypeScript
33 lines
1011 B
TypeScript
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
|
|
import { inspectDiscordAccount } from "./account-inspect.js";
|
|
import {
|
|
auditDiscordChannelPermissionsWithFetcher,
|
|
collectDiscordAuditChannelIdsForAccount,
|
|
type DiscordChannelPermissionsAudit,
|
|
} from "./audit-core.js";
|
|
import { fetchChannelPermissionsDiscord } from "./send.js";
|
|
|
|
export function collectDiscordAuditChannelIds(params: {
|
|
cfg: OpenClawConfig;
|
|
accountId?: string | null;
|
|
}) {
|
|
const account = inspectDiscordAccount({
|
|
cfg: params.cfg,
|
|
accountId: params.accountId,
|
|
});
|
|
return collectDiscordAuditChannelIdsForAccount(account.config);
|
|
}
|
|
|
|
export async function auditDiscordChannelPermissions(params: {
|
|
cfg: OpenClawConfig;
|
|
token: string;
|
|
accountId?: string | null;
|
|
channelIds: string[];
|
|
timeoutMs: number;
|
|
}): Promise<DiscordChannelPermissionsAudit> {
|
|
return await auditDiscordChannelPermissionsWithFetcher({
|
|
...params,
|
|
fetchChannelPermissions: fetchChannelPermissionsDiscord,
|
|
});
|
|
}
|