From da9b7d1ad68d75053ddb86c6dd9eefa862d6ac93 Mon Sep 17 00:00:00 2001 From: Stefan de Konink Date: Tue, 22 Oct 2024 23:20:03 +0200 Subject: [PATCH 1/3] Don't use KeyboardBuilder directly As discussed in issue #1595 KeyboardBuilder should not be used directly. Instead InlineKeyboardBuilder or ReplyKeyboardBuilder should be used. This fix makes sure that the documentation rendered does not include a "wrong example". --- aiogram/utils/keyboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiogram/utils/keyboard.py b/aiogram/utils/keyboard.py index 921c28c1..da0a105f 100644 --- a/aiogram/utils/keyboard.py +++ b/aiogram/utils/keyboard.py @@ -152,7 +152,7 @@ class KeyboardBuilder(Generic[ButtonType], ABC): .. code-block:: python - >>> builder = KeyboardBuilder(button_type=InlineKeyboardButton) + >>> builder = InlineKeyboardBuilder(button_type=InlineKeyboardButton) >>> ... # Add buttons to builder >>> markup = InlineKeyboardMarkup(inline_keyboard=builder.export()) From a6c184236d15c78071bd809aca12d319b5629b29 Mon Sep 17 00:00:00 2001 From: Stefan de Konink Date: Tue, 22 Oct 2024 23:47:03 +0200 Subject: [PATCH 2/3] Mandatory CHANGES --- CHANGES/1596.misc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 CHANGES/1596.misc.rst diff --git a/CHANGES/1596.misc.rst b/CHANGES/1596.misc.rst new file mode 100644 index 00000000..126d685b --- /dev/null +++ b/CHANGES/1596.misc.rst @@ -0,0 +1 @@ +Make sure KeyboardBuilder is not suggested to be used directly in the documentation. From 63b620aa95bf4326e7863ffc425b60ef20bdbf23 Mon Sep 17 00:00:00 2001 From: Stefan de Konink Date: Tue, 22 Oct 2024 23:47:49 +0200 Subject: [PATCH 3/3] Right category --- CHANGES/{1596.misc.rst => 1596.doc.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CHANGES/{1596.misc.rst => 1596.doc.rst} (100%) diff --git a/CHANGES/1596.misc.rst b/CHANGES/1596.doc.rst similarity index 100% rename from CHANGES/1596.misc.rst rename to CHANGES/1596.doc.rst