Openbot API 1.0.0
Python library to check Telegram user roles and levels against your Openbot ID server.
Install
pip install openbot_api
Until the new package is published to PyPI, install the local wheel included in the release archive.
Usage
import os
import telebot
import openbot_api
bot = telebot.TeleBot(os.environ["TELEGRAM_BOT_TOKEN"])
openbot = openbot_api.OpenbotAPI(api_key=os.environ["OPENBOT_API_KEY"], bot=bot)
@bot.message_handler(commands=["start"])
@openbot.check_level("tester", level=2)
@openbot.check_level("developer", level=2)
def start(message):
bot.reply_to(message, "✅ Доступ разрешён!")
bot.infinity_polling()
Two stacked check_level decorators grant access if either status and its required level match.
Other methods: get_user(id), get_status(id), get_level(id), has_level(id, role, level), check_access(id), and require_access().
The API key is a secret. Do not commit it to Git, place it in bot source, or share it publicly. The client is intentionally read-only: new keys may only be issued by an authorized administrator on the server, not through an unauthenticated public endpoint.
API keys on Linux server
See server-key-tools/README.md in the release archive. Back up your existing key database before replacing any existing files. api_keys.py and manage_keys.py are server-side tools and must not be published as part of the Python package.
Metadata
Release files for openbot-api 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openbot_api-1.0.0.tar.gz | 4.7 kB | Without provenance | Details for openbot_api-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openbot_api-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for openbot_api-1.0.0-py3-none-any.whl |
Total release size: 9.8 kB
Release files / openbot_api-1.0.0.tar.gz
| Download URL | openbot_api-1.0.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef781b0853f4a5dc2b334d6b2669afff27036a3458cc77e4c22c8a2d837b20ed
|
|
BLAKE2b-256 checksum How to use checksums |
1f765fd3733d779f8286c2ef93d1b40b4864efa4153ea22375c84908b4e765a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / openbot_api-1.0.0-py3-none-any.whl
| Download URL | openbot_api-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4d403155ac199cc4f22dbc69fcab65e0dfb82484a8a56b0a1822980fbdbd131
|
|
BLAKE2b-256 checksum How to use checksums |
3f1ca7cffe4534a1208e5256da3021564300b97ef3b0f4c3c7fe4ee8ffe0f21e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Security for openbot-api 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.