BotBase/METHODS.md

16 lines
715 B
Markdown
Raw Normal View History

# BotBase - Methods overview
2020-07-03 18:40:44 +02:00
BotBase has a builtin wrapper around Pyrogram objects that make
it even easier to use them properly.
2020-07-03 18:40:28 +02:00
**DISCLAIMER**: The ``MethodWrapper`` class is just a wrapper around Pyrogram.
2020-07-03 18:40:28 +02:00
To use the "safe" methods, just import the `MethodWrapper` class from `BotBase.methods`
2020-06-15 14:15:50 +02:00
and pass it a `pyrogram.Client` **instance** (not the class) or a `pyrogram.CallbackQuery`
or even a `pyrogram.InlineQuery` object. Then you can just call `wrapper.method` rather than `client.method`.
2020-06-15 14:15:50 +02:00
This way, the calls will never trigger exceptions and will log errors to stderr.
If an exception occurs, the exception object is returned, otherwise whatever
the called pyrogram method returns will be returned.