This directory contains a small maintenance workflow for updating an nmBot keyword-reply template.
The current template in this directory is a user-facing Telegram auto-reply for the subscription-source keyword flow. It is not developer documentation.
This is the single source of truth for the bot reply text.
What it is:
- A Telegram bot auto-reply message
- Written for end users in the Syncnext Telegram group
- Intended to explain how to use subscription sources inside the app
What it is not:
- Not internal engineering documentation
- Not a full source-of-truth database
- Not a schema or API contract
Audience:
- Existing Syncnext users
- New users asking how subscription sources work
- Telegram group members who need a copy-paste style reply
Content style:
- User-facing
- Direct and operational
- Plain text only
- Written as final reply text, not as notes for maintainers
Rules:
- Use plain text only
- Do not use Markdown formatting
- Write the text exactly as it should appear in Telegram
- Line breaks and blank lines are preserved
auto-message.txt is maintained from a mix of verifiable project data and operator-maintained group information.
Usually verifiable from the workspace:
SyncnextAPI/sourcesv3.jsonSyncnextAPI/sources18.jsonSyncnextAPI/source_ali.jsonsyncnextPlugin_icyl/sourcesv3-lite.jsonsyncnextPlugin_icyl/sourcesv3-18x.jsonsyncnextPlugin_icyl/sourcesv3.jsonSyncnextPlugin_nqaq/sourcesv3_qoli.json- App behavior or wording inside
Syncnext/when relevant
May require manual confirmation from the Telegram group or maintainers:
- Human-facing short codes or “subscription passwords”
- Group-specific operating instructions
- Third-party source distribution details
- Any wording that depends on current group policy rather than repository state
Maintenance rule:
- If a line can be verified from repository files, verify it before editing
- If a line is group-operations information, keep it clearly user-facing and confirm it from current practice
- Do not present guesses as confirmed facts
This file contains the operational target for the update script.
It currently defines:
chatIdtemplateIdtitlekeyboard
Use this file when:
- the target template changes
- the target Telegram group changes
- the inline buttons need to be updated
Do not edit Python constants for these values unless the config format itself needs to change.
This script performs two steps:
- Connect to an already logged-in Arc browser session through
playwright-cli - Read the current nmBot
session_idfrom browser storage and submit the template update via Python HTTP
Local Playwright config for connecting to Arc CDP on http://127.0.0.1:9222.
Before running an update, make sure:
python3is installedplaywright-cliis installed- Arc is running with CDP enabled
- Arc is logged in to
https://nmbot.nmnm.fun/ - The nmBot group management page is accessible
If Arc is not already running with CDP enabled:
open -a "Arc" --args --remote-debugging-port=9222 --remote-allow-origins='*'Update:
telegram-nmbot/auto-message.txt
Recommendations:
- Keep the message written for Telegram group users, not maintainers
- Avoid Markdown syntax
- Use full URLs if a link should be visible
- Prefer short operational wording over explanations about repository internals
- Re-check dates, source lists, and URLs before pushing
- If the message includes counts or lists of channels, verify them against the current JSON files
- If the message includes group workflow instructions, confirm they still match current moderator practice
- Re-read the final text once before pushing
Update telegram-nmbot/config.json only if one of these changes:
- target
chatId - target
templateId - template
title - inline keyboard buttons
If the task is only a wording/content update, you usually do not need to touch config.json.
Before pushing an update to the bot, go through this checklist:
- Confirm the task is user-facing Telegram reply maintenance, not developer documentation work.
- Edit
auto-message.txtonly for reply text changes. - Verify repository-backed facts against current files:
SyncnextAPI/sourcesv3.jsonSyncnextAPI/sources18.jsonSyncnextAPI/source_ali.jsonSyncnextPlugin_nqaq/sourcesv3_qoli.jsonsyncnextPlugin_icyl/sourcesv3-lite.jsonsyncnextPlugin_icyl/sourcesv3-18x.jsonsyncnextPlugin_icyl/sourcesv3.json
- Confirm any group-operation wording with current moderator or operator practice.
- Check dates, URLs, short codes, and button destinations.
- If needed, update
config.json. - Run
--dry-run. - Review the dry-run summary carefully.
- Submit the update.
- Verify that the API response reports success for the expected template.
From the workspace root:
python3 telegram-nmbot/edit-bot-message.py --dry-runThis does not update the remote template. It only verifies:
auto-message.txtcan be loadedconfig.jsoncan be loaded- Arc / CDP is reachable
- nmBot is logged in
- a usable
session_idis available
After a successful dry run:
python3 telegram-nmbot/edit-bot-message.pySuccess should include:
"ok": true"status": 200
Default target settings now come from:
telegram-nmbot/config.json
You can override them from the command line:
python3 telegram-nmbot/edit-bot-message.py --template-id 12345 --chat-id -1000000000000python3 -m py_compile telegram-nmbot/edit-bot-message.pypython3 telegram-nmbot/edit-bot-message.py --message-file /path/to/other.txtpython3 telegram-nmbot/edit-bot-message.py --config-file /path/to/config.jsonpython3 telegram-nmbot/edit-bot-message.py --keep-openCommon causes:
- Arc is not logged in to nmBot
- Arc was not started with CDP enabled
- the script is pointing at the wrong browser session
Fix:
- Open
https://nmbot.nmnm.fun/in Arc - Confirm the account is logged in
- Retry the dry run
Common causes:
- the browser
session_idexpired - the target template does not exist
- permission was lost
- the website is temporarily failing
Fix:
- Re-open the nmBot panel in Arc
- Run
--dry-runagain - Submit again
Check:
- extra blank lines
- accidental Markdown markers
- wrong URLs, passwords, or group commands
- Only edit
auto-message.txtfor message content changes - Edit
config.jsononly for target/template/button changes - Do not hardcode session tokens into scripts
- Always run
--dry-runbefore a real update - Keep local machine-specific overrides out of version control
- Treat
auto-message.txtas a user support artifact, not a developer note - When repository facts and Telegram operational practice diverge, resolve that intentionally before publishing