#Code Blocks Broken Up

1 messages · Page 1 of 1 (latest)

tepid silo
#

Whenever I receive code blocks from OC, they're broken up to unusable copy/paste counts. Is there a fix to merge them into one?

jade rainBOT
atomic mortarBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

grave breachBOT
#

Yep, partly.

On Discord there are two things that split replies:

  1. OpenClaw soft line cap: channels.discord.maxLinesPerMessage defaults to 17, so tall code blocks get split even if they are under 2000 chars.
  2. Discord hard text cap: plain messages still cap at about 2000 chars, so super long code blocks cannot be merged into one normal message.

The first fix to try is bumping the line cap:

openclaw config set channels.discord.maxLinesPerMessage 200 --strict-json
openclaw gateway restart

If you have streaming/block replies enabled, also turn those off, because they can fragment output further.

If the code block is still longer than Discord’s hard limit, then no config can make that a single plain message, the workaround is to have OC send it as a file/attachment instead.