Discord post
Apply socialkit-social-core. Official API only. Setup: setup.
Rules
- Mentions never ping unless options.allowMentions is true; only set it when the user asks.
- The webhook URL is a secret; refer to it only by its environment variable name.
Steps
- Check the credentials in setup are set (environment variables only).
- Create the post folder with the socialkit-social-core post script:
node <socialkit-social-core>/scripts/post.mjs --init --dir dc-<slug> --platform discord --kind <text|media> - Write
post.json(text, media with alt text, options). Seenode scripts/publish.mjs --help. - Validate:
node scripts/publish.mjs --check --dir dc-<slug> - Stop. Show the post. Ask the user to approve in their own terminal:
node <socialkit-social-core>/scripts/post.mjs --approve --dir dc-<slug> - Publish:
node scripts/publish.mjs --publish --dir dc-<slug>and report the result.
Failure handling
DISCORD_404: the webhook was deleted; create a new one. Do not retry the old URL.APPROVAL_REQUIRED: the post changed after approval; ask again.ALREADY_PUBLISHED: this folder was posted; use--allow-repostonly if the user asks.
