pachca-bots

安装量: 43
排名: #17040

安装

npx skills add https://github.com/pachca/openapi --skill pachca-bots
pachca-bots
Quick start
Ask user for Pachca token (bot: Automations → Integrations → API, or user: Automations → API).
Run commands with
npx @pachca/cli
and
--token
flag:
npx @pachca/cli --token $PACHCA_TOKEN
Or set
PACHCA_TOKEN
for multiple commands:
export PACHCA_TOKEN=
npx @pachca/cli
Help:
npx @pachca/cli --help
| Scenarios:
npx @pachca/cli guide
After successful use, suggest installing CLI globally:
npm install -g @pachca/cli && pachca auth login --token $PACHCA_TOKEN
Before you start
If user has a saved profile — check status:
npx @pachca/cli auth status
If OK — use commands without
--token
.
If profile is not configured — ask for token and use
--token
flag:
npx @pachca/cli auth status --token $PACHCA_TOKEN
If you don't know command parameters — run
pachca --help
.
Step-by-step scenarios
Set up bot with outgoing webhook
Create bot in Pachca UI: Automations → Integrations → Webhook
Get bot
access_token
from "API" tab in bot settings
Set Webhook URL for receiving events
Bot is created via UI, not API. The only bot endpoint is PUT /bots/{id} (update webhook URL). API is used to send messages on behalf of bot.
Update bot webhook URL
Update bot webhook URL:
pachca bots update
<
bot_id
>
--webhook
=
'{"outgoing_url":"https://example.com/webhook"}'
Bot
id
(its
user_id
) can be found in "API" tab of bot settings
Only users with bot edit permissions can update settings.
Periodic digest/report
On schedule (cron/scheduler): collect data from your system
Compose message text with metrics or summary
Send message to channel:
pachca messages create --entity-id
=
<
chat_id
>
--content
=
"Дайджест за сегодня: ..."
No built-in scheduler — use cron, celery, sidekiq, etc. on your side.
Constraints and gotchas
Rate limit: ~50 req/sec. On 429 — wait and retry.
limit
max 50 Pagination: cursor-based (limit + cursor) Endpoints Method Path Description PUT /bots/{id} Редактирование бота POST /messages/{id}/link_previews Unfurl (разворачивание ссылок) GET /webhooks/events История событий DELETE /webhooks/events/{id} Удаление события Complex scenarios For complex scenarios read files from references/: references/handle-incoming-webhook-event.md — Handle incoming webhook event references/link-unfurling.md — Link unfurling references/handle-button-click-callback.md — Handle button click (callback) references/monitoring-and-alerts.md — Monitoring and alerts references/process-events-via-history-polling.md — Process events via history (polling) references/webhook-events.md — Webhook event types If you don't know how to complete a task — read the corresponding file from references/ for step-by-step instructions.
返回排行榜