Skip to content

Commit 52f2522

Browse files
committed
fix(discord): preserve reusable presentation conversion
1 parent 8b8b583 commit 52f2522

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Docs: https://docs.openclaw.ai
1515
- CLI/message: include a stable top-level `messageId` in `openclaw message --json` output when channel sends return one. (#84191) Thanks @100menotu001.
1616
- Gateway/agents: use an agent's `identity.name` in Gateway agent summaries when `agents.list[].name` is unset, so configured agent labels remain visible in clients. (#84355; refs #57835) Thanks @luoyanglang.
1717
- Plugins/hooks: apply a default 30-second timeout to `before_compaction` and `after_compaction` hooks so a hung plugin handler no longer blocks compaction completion. (#84153)
18+
- Discord: preserve reusable presentation buttons through portable conversion and Discord component registration. (#84187) Thanks @100menotu001.
1819
- Discord: preserve disabled presentation buttons when adapting and rendering Discord message controls. (#84188) Thanks @100menotu001.
1920
- Twitch: add a test-only client-manager registry reset helper so non-isolated Twitch tests can clear cached managers between cases. Fixes #83887. (#84244) Thanks @hclsys.
2021
- Cron: use structured embedded-run denial metadata for isolated scheduled tasks so blocked exec requests fail the job without treating ordinary assistant prose as a denial. (#84067) Thanks @abnershang.

‎src/interactive/payload.test.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,14 @@ describe("interactive payload helpers", () => {
173173
{ type: "divider" as const },
174174
{
175175
type: "buttons" as const,
176-
buttons: [{ label: "Approve", value: "approve", style: "success" as const }],
176+
buttons: [
177+
{
178+
label: "Approve",
179+
value: "approve",
180+
style: "success" as const,
181+
reusable: true,
182+
},
183+
],
177184
},
178185
{
179186
type: "select" as const,
@@ -189,7 +196,7 @@ describe("interactive payload helpers", () => {
189196
{ type: "text", text: "Canary is ready." },
190197
{
191198
type: "buttons",
192-
buttons: [{ label: "Approve", value: "approve", style: "success" }],
199+
buttons: [{ label: "Approve", value: "approve", style: "success", reusable: true }],
193200
},
194201
{
195202
type: "select",
@@ -202,7 +209,7 @@ describe("interactive payload helpers", () => {
202209
blocks: [
203210
{
204211
type: "buttons",
205-
buttons: [{ label: "Approve", value: "approve", style: "success" }],
212+
buttons: [{ label: "Approve", value: "approve", style: "success", reusable: true }],
206213
},
207214
{
208215
type: "select",

‎src/interactive/payload.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ export function presentationToInteractiveReply(
369369
if (button.disabled === true) {
370370
interactiveButton.disabled = true;
371371
}
372+
if (button.reusable === true) {
373+
interactiveButton.reusable = true;
374+
}
372375
return interactiveButton;
373376
});
374377
if (buttons.length > 0) {

0 commit comments

Comments
 (0)