BotBase/METHODS.md

49 lines
1.6 KiB
Markdown
Raw Normal View History

# BotBase - Methods overview
BotBase has a builtin collection of wrappers around Pyrogram methods that make
it even easier to use them properly.
**DISCLAIMER**: These methods are just wrappers around Pyrogram's ones and behave
exactly the same. Every method listed here takes 2 extra arguments,
namely a `Client`/`CallbackQuery` instance and a boolean parameter (read below)
All other arguments, including keyword ones, are passed to pyrogram directly.
The methods are wrapped in try/except blocks and log automatically all errors
to the console. Also, if `sleep=True` (which is by default) if the method raises
a `FloodWait` exception, the wrapper will sleep the required amount of time and
then return the `FloodWait` exception. If `sleep=False` the exception is returned
immediately. All other exceptions are catched under `RPCError` and are returned
if they get raised, too. If no exception occurs the wrapper will return whatever
the corresponding pyrogram method returns.
## Methods - Safe send
List of the available functions in `BotBase.methods.safe_send`
2020-06-05 21:26:37 +02:00
- `send_message`
- `send_photo`
- `send_audio`
- `send_animation`
- `send_sticker`
These are the exact names that pyrogram uses, to see their docs refer to
[pyrogram docs](https://docs.pyrogram.org/api/methods/)
## Methods - Safe edit
List of the available functions in `BotBase.methods.safe_edit`
2020-06-05 21:26:37 +02:00
- `edit_message_text`
- `edit_message_media`
- `edit_message_caption`
## Methods - Various
List of the available functions in `BotBase.methods.various`
2020-06-05 21:26:37 +02:00
- `answer` (for `CallbackQuery` objects)
- `delete_messages`
- `get_users`