Pyrogram v0.7.2#
Keyboards and Callback Queries#
New Features#
Send normal and inline keyboards by using the new
reply_markup
parameter available for everysend_*
method (only applicable to bots, users can’t send keyboards).The new CallbackQueryHandler allows you to handle callback queries (only applicable to bots, users can’t receive callback queries). The on_callback_query() decorator is also available.
Additions#
The workdir parameter of the Client class lets you specify a custom working directory for you session files.
Enable the debug mode by passing
debug=True
to the start() method.Access all matches of your Filters.regex pattern using
message.matches
.Specify custom prefixes and separators for Filters.command and access the arguments via
messages.command
.New
outgoing
field and filter to easily tell incoming and outgoing messages apart.The new get_users() method allows to fetch basic information about a User.
edit_message_reply_markup() lets you edit only the reply markup of a bot message.
You can now pass extra arguments to your
progress
callback function by usingprogress_args
available for everysend_*
methods (media upload only). This is useful, for example, if you want to pass a chat_id and a message_id in order to edit a message with the updated progress.New remove_handler() method used to remove a previously registered handler. add_handler() can also return a tuple of (handler, group) which can be stored and directly passed to remove_handler(). Thanks @JosXa!
Answer callback_queries with answer_callback_query().
Enhancements#
The revamped get_user_profile_photos() method now returns the new UserProfilePhotos object.
Is now possible to pass chat actions as string, like “typing”, “upload_video”, …
Forwarding, deleting and getting messages has become easier; you can pass a single message id or a list of such, as well as an iterator or a generator to the
message_ids
parameter.Base types, such as
int
andstr
are now hinted on every raw function and type parameter.send_message() is now returning the correct Message object.