11// Discord plugin module implements runtime.messaging.send behavior.
22import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime" ;
3+ import { createReusableDiscordReplyReference } from "../reply-reference.js" ;
34import {
45 assertMediaNotDataUrl ,
56 jsonResult ,
@@ -250,7 +251,7 @@ export async function handleDiscordMessageSendAction(ctx: DiscordMessagingAction
250251 {
251252 ...ctx . withOpts ( ) ,
252253 silent,
253- replyTo : replyTo ?? undefined ,
254+ reply : createReusableDiscordReplyReference ( replyTo ) ,
254255 sessionKey : sessionKey ?? undefined ,
255256 agentId : agentId ?? undefined ,
256257 mediaUrl : mediaUrl ?? undefined ,
@@ -284,7 +285,7 @@ export async function handleDiscordMessageSendAction(ctx: DiscordMessagingAction
284285 assertMediaNotDataUrl ( mediaUrl ) ;
285286 const result = await discordMessagingActionRuntime . sendVoiceMessageDiscord ( to , mediaUrl , {
286287 ...ctx . withOpts ( ) ,
287- replyTo,
288+ reply : createReusableDiscordReplyReference ( replyTo ) ,
288289 silent,
289290 } ) ;
290291 return jsonResult (
@@ -303,7 +304,7 @@ export async function handleDiscordMessageSendAction(ctx: DiscordMessagingAction
303304 filename : filename ?? undefined ,
304305 mediaLocalRoots : ctx . options ?. mediaLocalRoots ,
305306 mediaReadFile : ctx . options ?. mediaReadFile ,
306- replyTo,
307+ reply : createReusableDiscordReplyReference ( replyTo ) ,
307308 components,
308309 embeds,
309310 silent,
@@ -413,7 +414,7 @@ export async function handleDiscordMessageSendAction(ctx: DiscordMessagingAction
413414 mediaUrl,
414415 mediaLocalRoots : ctx . options ?. mediaLocalRoots ,
415416 mediaReadFile : ctx . options ?. mediaReadFile ,
416- replyTo,
417+ reply : createReusableDiscordReplyReference ( replyTo ) ,
417418 } ,
418419 ) ;
419420 return jsonResult ( { ok : true , result } ) ;
0 commit comments