mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-30 09:33:38 +00:00
`chunkDiscordText` reserved closing-fence space from the post-line fence state (`nextOpenFence`), but a flush during a line's segment loop appends the closing fence based on the still-open `openFence`, which is only advanced after the line. On a line that closes a fence yet carries trailing text, `reserveChars` was 0 while `flush()` still appended a `` ``` ``, producing a chunk of `maxChars + 4` (e.g. 2004 > 2000) that Discord rejects with HTTP 400. Reserve against `nextOpenFence ?? openFence` so whichever fence a flush can close is accounted for, keeping a fence-closing line's chunk within `maxChars`. Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
OpenClaw Discord
Official OpenClaw channel plugin for Discord servers, channels, DMs, slash commands, and app events.
Install from OpenClaw:
openclaw plugin add @openclaw/discord
Configure a Discord bot token and the channels or servers OpenClaw should handle. The plugin lets OpenClaw agents receive Discord messages and respond through the configured Discord app.