mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-10 00:31:22 +00:00
13 lines
616 B
TypeScript
13 lines
616 B
TypeScript
import { createEnvPatchedAccountSetupAdapter } from "openclaw/plugin-sdk/setup-adapter-runtime";
|
|
import type { ChannelSetupAdapter } from "openclaw/plugin-sdk/setup-runtime";
|
|
|
|
const channel = "discord" as const;
|
|
|
|
export const discordSetupAdapter: ChannelSetupAdapter = createEnvPatchedAccountSetupAdapter({
|
|
channelKey: channel,
|
|
defaultAccountOnlyEnvError: "DISCORD_BOT_TOKEN can only be used for the default account.",
|
|
missingCredentialError: "Discord requires token (or --use-env).",
|
|
hasCredentials: (input) => Boolean(input.token),
|
|
buildPatch: (input) => (input.token ? { token: input.token } : {}),
|
|
});
|