📘 API Reference¶
The reference section provides a technical, low-level view of the core pieces of django-telegram-app – classes, models, configuration, and checks.
Unlike tutorials (which show you how to build something) and topic guides (which explain why things are designed the way they are), this section answers:
“What attributes and methods does this class have, and how do I use them correctly?”
You’ll typically come here when you already know which component you want to use
(e.g. Step, TelegramSettings, CallbackData) and need the details.
Bot API¶
These pages cover the core building blocks you use to implement and test commands.
-
BaseBotCommand
The base class for all bot commands.
Describes how commands are constructed, how thestepssequence works, and how to start, finish, cancel, and navigate between steps. -
Step
The building block of multi-step conversations.
Documents thehandle()method, callback helpers (next_step_callback,previous_step_callback, etc.), and utilities likeget_callback_data()andadd_waiting_for(). -
TelegramUpdate
A normalized wrapper around Telegram’s raw update payload.
Explains how messages and callback queries are represented and how to inspect chat IDs, message text, callback data, and type helpers likeis_message(). -
TestCases
Reference for the testing helpers (e.g.TelegramBotTestCase).
Covers methods such assend_text(),click_on_button(),last_bot_message, and how the bot client is mocked in tests.
Core Models¶
These models underpin the persistence and routing of Telegram-related data.
-
CallbackData
Stores structured callback payloads for inline buttons.
Documents the data structure, token field, correlation key, and lifecycle. -
Message
Represents incoming and outgoing messages for logging and debugging.
Details the fields used to trace bot interactions. -
TelegramSettings
The per-chat configuration and state model.
Explains required fields, thedataJSON field, and how to swap in your own implementation viaTELEGRAM_SETTINGS_MODEL.
System Checks¶
- Checks
Describes the Django system checks registered bydjango-telegram-app.
Use this reference to understand what each check validates, what the messages mean, and how to resolve configuration or integration issues highlighted bymanage.py check.
Configuration¶
- Configuration
A complete reference of all settings used by django-telegram-app.
Includes required and optional settings, defaults, and how they interact (e.g. webhook URL parts, swappable models, admin registration flags).
How to use this section¶
- If you’re implementing a new command, start with:
- BaseBotCommand
- Step
-
If you’re debugging callbacks or state, refer to:
- CallbackData
-
If you’re configuring or integrating into a larger project, check:
- Configuration
- Checks
The reference is meant to be lookup-friendly: jump in, find the class or setting you care about, and get back to building your bot.