BotBase/METHODS.md

747 B

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 the same way.

To use the "safe" methods, just import the MethodWrapper`` class from BotBase.methodsand pass it apyrogram.Client**instance** (not the class) or apyrogram.CallbackQueryor even apyrogram.InlineQueryobject. Then you can just callwrapper.methodrather thanclient.method`.

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.