API reference¶
These pages are generated from the docstrings in the code. Everything public is importable
from pgpcbot:
from pgpcbot import Bot, Button, InlineKeyboard, filters as f
Names that start with _ (modules and attributes) are internal and can change in any
version. The same documentation is available without a browser: help(pgpcbot.Bot) in
Python, or python -m pydoc pgpcbot.Bot in a terminal.
Where to find what¶
Page |
Contents |
|---|---|
|
|
|
|
the objects the API returns and handlers receive |
|
|
|
|
|
every exception, with the server’s error codes |
Conventions¶
Async and sync. Every async class has a sync twin with the same methods: on the sync one, call them without
await(Async and sync).Keyword arguments. Options are keyword-only; only the main values (the chat, the text, the IDs) are positional.
Chats. Bot methods take a chat ID or any chat object (a
Chat, aChatRef,message.chat).Validation. Input is checked against the server’s rules before anything is sent: a
ValidationErrormeans nothing left the process.Errors. Each method lists the errors specific to it. Any call that reaches the server can also raise the errors listed in Errors every method can raise.
Models are read-only and keep the server’s JSON in
raw.