Discord Message Preparer — Split Long Text and Code avatar

Discord Message Preparer — Split Long Text and Code

Pricing

$10.00 / 1,000 prepared texts

Go to Apify Store
Discord Message Preparer — Split Long Text and Code

Discord Message Preparer — Split Long Text and Code

Split long text and supported code blocks into ordered Discord JSON payloads under 2000 characters, with mentions disabled. No bot token, no message sending. $0.01 per prepared text.

Pricing

$10.00 / 1,000 prepared texts

Rating

0.0

(0)

Developer

Stefan Schellen

Stefan Schellen

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Categories

Share

Discord Message Preparer

Prepare long release notes or AI responses as ordered Discord JSON payloads. Call this utility from an HTTP workflow, then send each returned payload yourself in order. This Actor does not send Discord messages or need a Discord token.

Why use it?

Discord webhook content is limited to 2,000 characters. Cutting at that limit can leave a code fence open, while truncation loses the end of your report. This utility splits text and closes/reopens supported code fences. Every payload disables mentions by default.

Free copy/paste splitters and local libraries are good alternatives. Use this hosted step when you want an API from n8n, Make or an agent without maintaining the parser. It is not a full Markdown renderer.

Input

{"text":"Release notes\n\n```python\nprint('Hello')\n```"}

The single text field accepts up to 65,536 UTF-8 bytes. Output is limited to 50 messages. If the whole input cannot be prepared within these limits, the run fails instead of returning a truncated partial result.

Output and sending

One dataset item contains messages, messageCount, normalizedSource, segments, omittedWhitespaceRanges and warnings. Each message includes zero-based index, sourceStart, sourceEnd and:

{"payload":{"content":"Release notes\n\n","allowed_mentions":{"parse":[],"replied_user":false}}}

Send the entire payload object, not just content, to your Discord webhook. Otherwise the mention policy is lost. Use sequential requests, respect Discord rate-limit responses and handle retries in your workflow. This utility provides no delivery or deduplication guarantee.

In n8n: obtain the dataset item, split out its messages array, loop with batch size 1, and POST payload as JSON to your own webhook. Keep the webhook URL in credentials; do not send it to this Actor. This recipe has not yet been imported and tested end to end.

Supported text and explicit limits

  • Plain text and column-zero triple-backtick code fences, with an optional language label up to 24 ASCII letters/digits or _+.-.
  • Code blocks may produce separate messages from adjacent prose. Each code fragment gets its own opening and closing fence.
  • Unclosed, indented, longer, inline or tilde fences are rejected. Embedded triple backticks inside code are rejected.
  • Other inline Markdown is passed through, but not rebalanced at split boundaries. Links, bold, spoilers and quotes can therefore render differently across messages. Do not use this for guaranteed preservation of arbitrary Markdown.
  • Each payload is capped at 2,000 UTF-16 code units conservatively. Unicode code points are not split, but combining characters and multi-code-point emoji can cross a boundary.
  • CRLF/CR line endings become LF. Whitespace-only chunks are omitted from sendable messages and recorded explicitly. The entire normalized source remains in the output.
  • Source offsets are Python/Unicode code-point offsets into normalizedSource, not UTF-16 or byte offsets. Segment ranges include original fences; message ranges refer to body text without generated wrappers.

Trial price

$0.01 per successfully prepared text input, regardless of how many parts it produces; platform usage included. Invalid inputs have no successful-processing event.

Data handling and verification

Input and output use Apify storage and its retention settings. Source text appears in the dataset and output record. Do not treat it as ephemeral or send secrets. The parser makes no network requests and receives no Apify credentials; the service saves output before charging and avoids recharging uncertain restarts.

Local tests cover payload limits, source coverage, Unicode, fences, mention fields, bounded worker execution and billing/restart behavior. Actual Discord acceptance and client rendering have not been tested. The Actor never posts messages on your behalf.

References: Discord webhook fields, n8n release-note limit report.