FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
stevekrouse
stevekrousesendDiscordMessage
Remix of ktodaz/sendDiscordMessage
Public
Like
1
sendDiscordMessage
Home
Code
2
README.md
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
README.md

Send Chunked Discord Message

This function is used to send a message to a Discord webhook. If the message exceeds the maximum character limit (2000 characters), it will be divided into chunks and sent as multiple messages.

Parameters

message (string): The message to be sent to the Discord webhook.

Return Value

This function does not return any value.

Example Usage:

const message = "This is a long message that needs to be sent to Discord. It may exceed the character limit, so it will be divided into smaller chunks.";
await @ktodaz.sendDiscordMessage(message);

In the above example, the sendDiscordMessage function is used to send the message to the Discord webhook. If the message exceeds 2000 characters, it will be split into smaller chunks and sent as separate messages.

Required Secrets:

Ensure you have added the secret for discord_webhook in your val.town secrets settings (Profile -> Secrets)

Migrated from folder: Archive/sendDiscordMessage

Code
README.mdmain.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesCLIAI agentsCode intelligenceSlack integrationsGTMPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.