Files
arestools/.claude/settings.local.json
T
ros 8bd13b4dd5 Перевести проект на Telegram Business (без хранения сессии)
Смена архитектуры с MTProto-юзербота (GramJS + строка сессии) на
официальное бизнес-подключение Telegram (Bot API). Проект больше НЕ
хранит сессию — работает только через бота с включённым Business Mode,
подключённого в Настройках → Telegram для бизнеса → Чат-боты. Это
соответствует ToS.

Изменения:
- удалено: scripts/login.js, src/userbot/client.js, модуль onetime
- src/userbot/ → src/business/: events.js подписывает business_message /
  edited / deleted / connection и нормализует сообщение; context.js даёт
  ctx.api = bot.api
- core/media.js: скачивание через getFile + fetch вместо GramJS
- core/db.js: составной ключ PRIMARY KEY (chat_id, msg_id) — в Bot API
  message_id уникален только внутри чата
- bot/panel.js: барьер владельца пропускает бизнес-апдейты (у них ctx.from
  это собеседник); убран UI одноразовых
- index.js: сборка только на grammY, явный allowed_updates с бизнес-типами
- config.js: убраны API_ID/API_HASH/SESSION, проверки на старте почищены
- package.json: убраны зависимости telegram и input, скрипт login
- README и .env.example переписаны под бизнес-подключение

Границы: onetime невозможен через Business API (сервер отбрасывает
self-destruct до доставки боту), медиа >~20 МБ не выгружаются (лимит
getFile), перехват — только личные 1-на-1 чаты.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 21:00:22 +03:00

51 lines
2.4 KiB
JSON

{
"permissions": {
"allow": [
"Bash(npm test *)",
"Bash(BOT_TOKEN=\"123456:AAFAKE_TOKEN_FOR_SMOKE_TEST\" LOG_LEVEL=debug timeout 25 node src/index.js)",
"Bash(timeout 20 node src/index.js)",
"Bash(BOT_TOKEN=\"123456:AAFAKE\" timeout 25 node src/index.js)",
"Bash(npm run *)",
"Bash(node -e ' *)",
"WebSearch",
"Bash(npm view *)",
"Bash(npm i *)",
"Bash(node -e \"console.log\\('telegram', require\\('telegram/package.json'\\).version\\)\")",
"Bash(node --input-type=module -e ' *)",
"Bash(node -e \"console.log\\(require\\('crypto'\\).randomBytes\\(32\\).toString\\('hex'\\)\\)\")",
"Bash(ENCRYPTION_KEY=__CMDSUB_OUTPUT__ RETENTION_DAYS=30 node --input-type=module -e ' *)",
"Bash(rmdir test *)",
"Bash(echo \"=== removed test/ \\(exit $?\\) ===\")",
"Bash(git commit *)",
"WebFetch(domain:core.telegram.org)",
"WebFetch(domain:grammy.dev)",
"WebFetch(domain:github.com)",
"WebFetch(domain:docs.aiogram.dev)",
"WebFetch(domain:telegram.org)",
"Bash(gh api *)",
"Bash(cd /tmp)",
"Bash(curl -sL \"https://raw.githubusercontent.com/tdlib/telegram-bot-api/master/telegram-bot-api/Client.cpp\" -o client.cpp)",
"Bash(awk 'NR<=18629 && /^[a-zA-Z].*Client::.*\\\\\\(/ {line=NR; text=$0} END{print line\": \"text}' client.cpp)",
"Bash(awk 'NR<=19167 && /^\\(void|bool|td|const|int|auto\\).*Client::.*\\\\\\(/ {line=NR; text=$0} END{print line\": \"text}' client.cpp)",
"Bash(awk 'NR<=19212 && /^\\(void|bool|td|const|int|auto\\).*Client::.*\\\\\\(/ {line=NR; text=$0} END{print line\": \"text}' client.cpp)",
"Bash(git add *)",
"WebFetch(domain:docs.python-telegram-bot.org)",
"Bash(curl -s \"https://core.telegram.org/bots/api-changelog\" -o /tmp/changelog.html)",
"Read(//tmp/**)",
"Bash(curl -s \"https://core.telegram.org/bots/api\" -o /tmp/api.html)",
"Bash(python -c ' *)",
"Bash(curl -s \"https://core.telegram.org/bots/api\" -o api.html)",
"Bash(curl -s \"https://core.telegram.org/bots/api-changelog\" -o changelog.html)",
"Bash(git rm *)",
"Bash(git mv *)",
"Bash(mkdir -p src/business)",
"Bash(rm -f api.html changelog.html)",
"Bash(rmdir src/userbot)",
"Bash(npm install *)",
"Bash(node _offline_test.mjs)",
"Bash(rm -f _offline_test.mjs)",
"Bash(rm -rf data)"
]
}
}