From 6e686fdd894af026a6de8a92e1ac13ff5f73d460 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 22 Dec 2018 14:18:23 +0100 Subject: [PATCH] Fix docs not using bytes when showing examples dealing with callback queries --- docs/source/resources/UsingFilters.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/resources/UsingFilters.rst b/docs/source/resources/UsingFilters.rst index 79ecd24f..d70005a5 100644 --- a/docs/source/resources/UsingFilters.rst +++ b/docs/source/resources/UsingFilters.rst @@ -162,7 +162,7 @@ yourself. This allows you to test your filter by pressing the inline button: "username", # Change this to your username or id "Pyrogram's custom filter test", reply_markup=InlineKeyboardMarkup( - [[InlineKeyboardButton("Press me", "pyrogram")]] + [[InlineKeyboardButton("Press me", b"pyrogram")]] ) ) @@ -178,7 +178,7 @@ containing "pyrogram" as data: hardcoded_data = Filters.create( name="HardcodedData", - func=lambda filter, callback_query: callback_query.data == "pyrogram" + func=lambda filter, callback_query: callback_query.data == b"pyrogram" ) The ``lambda`` operator in python is used to create small anonymous functions and is perfect for this example, the same @@ -187,7 +187,7 @@ could be achieved with a normal function, but we don't really need it as it make .. code-block:: python def func(filter, callback_query): - return callback_query.data == "pyrogram" + return callback_query.data == b"pyrogram" hardcoded_data = Filters.create( name="HardcodedData", @@ -223,6 +223,6 @@ And its usage: .. code-block:: python - @app.on_callback_query(dynamic_data("pyrogram")) + @app.on_callback_query(dynamic_data(b"pyrogram")) def pyrogram_data(client, callback_query): client.answer_callback_query(callback_query.id, "it works!") \ No newline at end of file