mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 10:27:38 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Button, type ButtonInteraction, type ComponentData } from "@buape/carbon";
|
||||
import { ButtonStyle, Routes } from "discord-api-types/v10";
|
||||
import type { MoltbotConfig } from "../../config/config.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { GatewayClient } from "../../gateway/client.js";
|
||||
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../../utils/message-channel.js";
|
||||
import type { EventFrame } from "../../gateway/protocol/index.js";
|
||||
@@ -187,7 +187,7 @@ export type DiscordExecApprovalHandlerOpts = {
|
||||
accountId: string;
|
||||
config: DiscordExecApprovalConfig;
|
||||
gatewayUrl?: string;
|
||||
cfg: MoltbotConfig;
|
||||
cfg: OpenClawConfig;
|
||||
runtime?: RuntimeEnv;
|
||||
onResolve?: (id: string, decision: ExecApprovalDecision) => Promise<void>;
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@ describe("discord processDiscordMessage inbound contract", () => {
|
||||
it("passes a finalized MsgContext to dispatchInboundMessage", async () => {
|
||||
capturedCtx = undefined;
|
||||
|
||||
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-discord-"));
|
||||
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-discord-"));
|
||||
const storePath = path.join(dir, "sessions.json");
|
||||
|
||||
await processDiscordMessage({
|
||||
|
||||
@@ -13,7 +13,9 @@ export type DiscordMessageEvent = import("./listeners.js").DiscordMessageEvent;
|
||||
|
||||
export type DiscordMessagePreflightContext = {
|
||||
cfg: LoadedConfig;
|
||||
discordConfig: NonNullable<import("../../config/config.js").MoltbotConfig["channels"]>["discord"];
|
||||
discordConfig: NonNullable<
|
||||
import("../../config/config.js").OpenClawConfig["channels"]
|
||||
>["discord"];
|
||||
accountId: string;
|
||||
token: string;
|
||||
runtime: RuntimeEnv;
|
||||
|
||||
@@ -30,7 +30,7 @@ vi.mock("../../auto-reply/reply/reply-dispatcher.js", () => ({
|
||||
import { processDiscordMessage } from "./message-handler.process.js";
|
||||
|
||||
async function createBaseContext(overrides: Record<string, unknown> = {}) {
|
||||
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-discord-"));
|
||||
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-discord-"));
|
||||
const storePath = path.join(dir, "sessions.json");
|
||||
return {
|
||||
cfg: { messages: { ackReaction: "👀" }, session: { store: storePath } },
|
||||
|
||||
@@ -17,7 +17,7 @@ import { resolveDiscordMessageText } from "./message-utils.js";
|
||||
|
||||
type LoadedConfig = ReturnType<typeof import("../../config/config.js").loadConfig>;
|
||||
type DiscordConfig = NonNullable<
|
||||
import("../../config/config.js").MoltbotConfig["channels"]
|
||||
import("../../config/config.js").OpenClawConfig["channels"]
|
||||
>["discord"];
|
||||
|
||||
export function createDiscordMessageHandler(params: {
|
||||
|
||||
@@ -32,7 +32,7 @@ import type {
|
||||
import { dispatchReplyWithDispatcher } from "../../auto-reply/reply/provider-dispatcher.js";
|
||||
import { finalizeInboundContext } from "../../auto-reply/reply/inbound-context.js";
|
||||
import type { ReplyPayload } from "../../auto-reply/types.js";
|
||||
import type { MoltbotConfig, loadConfig } from "../../config/config.js";
|
||||
import type { OpenClawConfig, loadConfig } from "../../config/config.js";
|
||||
import { buildPairingReply } from "../../pairing/pairing-messages.js";
|
||||
import {
|
||||
readChannelAllowFromStore,
|
||||
@@ -55,7 +55,7 @@ import { formatDiscordUserTag } from "./format.js";
|
||||
import { resolveDiscordChannelInfo } from "./message-utils.js";
|
||||
import { resolveDiscordThreadParentInfo } from "./threading.js";
|
||||
|
||||
type DiscordConfig = NonNullable<MoltbotConfig["channels"]>["discord"];
|
||||
type DiscordConfig = NonNullable<OpenClawConfig["channels"]>["discord"];
|
||||
|
||||
function buildDiscordCommandOptions(params: {
|
||||
command: ChatCommandDefinition;
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
resolveNativeCommandsEnabled,
|
||||
resolveNativeSkillsEnabled,
|
||||
} from "../../config/commands.js";
|
||||
import type { MoltbotConfig, ReplyToMode } from "../../config/config.js";
|
||||
import type { OpenClawConfig, ReplyToMode } from "../../config/config.js";
|
||||
import { loadConfig } from "../../config/config.js";
|
||||
import { danger, logVerbose, shouldLogVerbose, warn } from "../../globals.js";
|
||||
import { formatErrorMessage } from "../../infra/errors.js";
|
||||
@@ -43,7 +43,7 @@ import { createExecApprovalButton, DiscordExecApprovalHandler } from "./exec-app
|
||||
export type MonitorDiscordOpts = {
|
||||
token?: string;
|
||||
accountId?: string;
|
||||
config?: MoltbotConfig;
|
||||
config?: OpenClawConfig;
|
||||
runtime?: RuntimeEnv;
|
||||
abortSignal?: AbortSignal;
|
||||
mediaMaxMb?: number;
|
||||
|
||||
Reference in New Issue
Block a user