mirror of https://github.com/nocturn9x/BotBase.git
747 B
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 a
pyrogram.Client**instance** (not the class) or a
pyrogram.CallbackQueryor even a
pyrogram.InlineQueryobject. Then you can just call
wrapper.methodrather than
client.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.