Telegram post
Apply socialkit-social-core. Official API only. Setup: setup.
Rules
- The bot must be an administrator of the channel with permission to post.
- Captions are limited to 1,024 characters; text messages to 4,096.
- Plain text by default; set options.parseMode to HTML only when formatting is needed.
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 tg-<slug> --platform telegram --kind <text|photo|video|album> - Write
post.json(text, media with alt text, options). Seenode scripts/publish.mjs --help. - Validate:
node scripts/publish.mjs --check --dir tg-<slug> - Stop. Show the post. Ask the user to approve in their own terminal:
node <socialkit-social-core>/scripts/post.mjs --approve --dir tg-<slug> - Publish:
node scripts/publish.mjs --publish --dir tg-<slug>and report the result.
Failure handling
TELEGRAM_403: add the bot as an admin of the channel.TELEGRAM_400chat not found: check TELEGRAM_CHAT_ID.APPROVAL_REQUIRED: the post changed after approval; ask again.ALREADY_PUBLISHED: this folder was posted; use--allow-repostonly if the user asks.
