1. Files and Class #
Docs list:
- File:
davix-telegram.php - Class:
Davix_Chatbot_Telegram
This class handles:
- Registration of REST endpoints.
- Communication with Telegram (via webhook or polling).
- Permission checks.
- Rate limiting.
2. REST API Namespace #
Docs say:
“REST endpoints (namespace
davix-ai-engine/v1):
○/human(POST) — send user message to Telegram.
○/human-poll(GET) — poll human replies (if using polling).
○/telegram-webhook(POST/GET) — webhook entry point from Telegram.”
So there are three REST endpoints:
- POST
/wp-json/davix-ai-engine/v1/human- Purpose: send user messages from the chat to Telegram.
- GET
/wp-json/davix-ai-engine/v1/human-poll- Purpose: fetch human replies from Telegram, if polling is used.
- POST/GET
/wp-json/davix-ai-engine/v1/telegram-webhook- Purpose: entry point for Telegram webhook updates.
image IMAGE PLACEHOLDER: Screenshot of a REST client (e.g., browser or API tester) hitting
/wp-json/davix-ai-engine/v1/humanand/telegram-webhook, illustrating developer view. IMAGE image
3. Permissions & Gating #
Docs clearly specify:
- All Telegram endpoints:
- Require
my_fs()->can_use_premium_code(). - If Pro license is missing → HTTP 403 (forbidden).
- Require
- Additional checks:
telegram_enabledmust be ON.telegram_modemust allow human usage.- If
telegram_logged_in_onlyis set:- User must be authenticated (nonce/cookie) to use human mode.
This ensures:
- No Telegram handoff is possible without an active Pro license.
- Only properly configured sites (with Telegram enabled and mode set) can send messages.
- Optionally, only logged-in users can access human support.
4. Webhook vs Polling #
Docs mention:
/human-pollis used “if using polling”./telegram-webhookis the webhook entry point from Telegram.
So you can integrate Telegram in two patterns:
- Webhook:
- Telegram sends updates to
/telegram-webhook. - Davix processes incoming messages and maps them back to the correct chat sessions.
- Telegram sends updates to
- Polling:
- Davix periodically calls
/human-pollfrom the front-end to fetch replies, if webhook is not used (or as a fallback, depending on your setup).
- Davix periodically calls
The exact choice depends on how you configure your Telegram bot, but the plugin provides both mechanisms.
5. Rate Limit Implementation #
Docs conclude:
“Rate Limiting
●check_rate_limit()uses WordPress transients.”
So internally:
check_rate_limit()is called when human messages are sent.- It tracks message counts using transients keyed by IP or session.
- If limits are exceeded, the system can prevent further messages from going through to Telegram.

