From 09043eaffe1d919a17766a49ba52a0bb526827bf Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sat, 22 Apr 2023 20:02:29 +0300 Subject: [PATCH] Clean docs --- docs/dispatcher/filters/index.rst | 9 +- docs/dispatcher/filters/text.rst | 35 ---- .../LC_MESSAGES/dispatcher/filters/text.po | 153 ------------------ 3 files changed, 4 insertions(+), 193 deletions(-) delete mode 100644 docs/dispatcher/filters/text.rst delete mode 100644 docs/locale/uk_UA/LC_MESSAGES/dispatcher/filters/text.po diff --git a/docs/dispatcher/filters/index.rst b/docs/dispatcher/filters/index.rst index 856b8677..9ac14213 100644 --- a/docs/dispatcher/filters/index.rst +++ b/docs/dispatcher/filters/index.rst @@ -16,7 +16,6 @@ Here is list of builtin filters: :maxdepth: 1 command - text chat_member_updated magic_filters magic_data @@ -69,7 +68,7 @@ If you specify multiple filters in a row, it will be checked with an "and" condi .. code-block:: python - @.message(Text(startswith="show"), Text(endswith="example")) + @.message(F.text.startswith("show"), F.text.endswith("example")) Also, if you want to use two alternative ways to run the same handler ("or" condition) @@ -77,7 +76,7 @@ you can register the handler twice or more times as you like .. code-block:: python - @.message(Text(text="hi")) + @.message(F.text == "hi") @.message(CommandStart()) @@ -96,7 +95,7 @@ An alternative way is to combine using special functions (:func:`and_f`, :func:` .. code-block:: python - and_f(Text(startswith="show"), Text(endswith="example")) - or_f(Text(text="hi"), CommandStart()) + and_f(F.text.startswith("show"), F.text.endswith("example")) + or_f(F.text(text="hi"), CommandStart()) invert_f(IsAdmin()) and_f(, or_f(, )) diff --git a/docs/dispatcher/filters/text.rst b/docs/dispatcher/filters/text.rst deleted file mode 100644 index 622f41d8..00000000 --- a/docs/dispatcher/filters/text.rst +++ /dev/null @@ -1,35 +0,0 @@ -==== -Text -==== - -.. autoclass:: aiogram.filters.text.Text - :members: - :member-order: bysource - :undoc-members: False - -Can be imported: - -- :code:`from aiogram.filters.text import Text` -- :code:`from aiogram.filters import Text` - -Usage -===== - -#. Text equals with the specified value: :code:`Text(text="text") # value == 'text'` -#. Text starts with the specified value: :code:`Text(startswith="text") # value.startswith('text')` -#. Text ends with the specified value: :code:`Text(endswith="text") # value.endswith('text')` -#. Text contains the specified value: :code:`Text(contains="text") # value in 'text'` -#. Any of previous listed filters can be list, set or tuple of strings that's mean any of listed value should be equals/startswith/endswith/contains: :code:`Text(text=["text", "spam"])` -#. Ignore case can be combined with any previous listed filter: :code:`Text(text="Text", ignore_case=True) # value.lower() == 'text'.lower()` - -Allowed handlers -================ - -Allowed update types for this filter: - -- :code:`message` -- :code:`edited_message` -- :code:`channel_post` -- :code:`edited_channel_post` -- :code:`inline_query` -- :code:`callback_query` diff --git a/docs/locale/uk_UA/LC_MESSAGES/dispatcher/filters/text.po b/docs/locale/uk_UA/LC_MESSAGES/dispatcher/filters/text.po deleted file mode 100644 index a19ae4ad..00000000 --- a/docs/locale/uk_UA/LC_MESSAGES/dispatcher/filters/text.po +++ /dev/null @@ -1,153 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2022, aiogram Team -# This file is distributed under the same license as the aiogram package. -# FIRST AUTHOR , 2022. -# -msgid "" -msgstr "" -"Project-Id-Version: aiogram\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-25 22:10+0300\n" -"PO-Revision-Date: 2022-10-25 17:49+0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.10.3\n" - -#: ../../dispatcher/filters/text.rst:3 -msgid "Text" -msgstr "Текст" - -#: aiogram.filters.text.Text:1 of -msgid "" -"Is useful for filtering text :class:`aiogram.types.message.Message`, any " -":class:`aiogram.types.callback_query.CallbackQuery` with `data`, " -":class:`aiogram.types.inline_query.InlineQuery` or " -":class:`aiogram.types.poll.Poll` question." -msgstr "" -"Корисно для фільтрації тексту :class:`aiogram.types.message.Message`, " -"будь-якого :class:`aiogram.types.callback_query.CallbackQuery` з `data`, " -":class:`aiogram.types.inline_query.InlineQuery` або : " -"class:`aiogram.types.poll.Poll` опитування." - -#: aiogram.filters.text.Text:7 of -msgid "" -"Only one of `text`, `contains`, `startswith` or `endswith` argument can " -"be used at once. Any of that arguments can be string, list, set or tuple " -"of strings." -msgstr "" -"Одночасно можна використати лише один із аргументів `text`, `contains`, " -"`startswith` або `endswith` . Будь-який із цих аргументів може бути " -"рядком, списком, набором (set) або кортежем рядків." - -#: aiogram.filters.text.Text:12 of -msgid "" -"use :ref:`magic-filter `. For example do :pycode:`F.text " -"== \"text\"` instead" -msgstr "" -"використати :ref:`magic-filter `. Наприклад " -":pycode:`F.text == \"text\"` instead" - -#: ../../dispatcher/filters/text.rst:10 -msgid "Can be imported:" -msgstr "Можна імпортувати:" - -#: ../../dispatcher/filters/text.rst:12 -msgid ":code:`from aiogram.filters.text import Text`" -msgstr ":code:`from aiogram.filters.text import Text`" - -#: ../../dispatcher/filters/text.rst:13 -msgid ":code:`from aiogram.filters import Text`" -msgstr ":code:`from aiogram.filters import Text`" - -#: ../../dispatcher/filters/text.rst:16 -msgid "Usage" -msgstr "Використання" - -#: ../../dispatcher/filters/text.rst:18 -msgid "" -"Text equals with the specified value: :code:`Text(text=\"text\") # value" -" == 'text'`" -msgstr "" -"Текст дорівнює вказаному значенню: :code:`Text(text=\"text\") # value ==" -" 'text'`" - -#: ../../dispatcher/filters/text.rst:19 -msgid "" -"Text starts with the specified value: :code:`Text(startswith=\"text\") #" -" value.startswith('text')`" -msgstr "" -"Текст починається з указаного значення: :code:`Text(startswith=\"text\")" -" # value.startswith('text')`" - -#: ../../dispatcher/filters/text.rst:20 -msgid "" -"Text ends with the specified value: :code:`Text(endswith=\"text\") # " -"value.endswith('text')`" -msgstr "" -"Текст закінчується вказаним значенням: :code:`Text(endswith=\"text\") # " -"value.endswith('text')`" - -#: ../../dispatcher/filters/text.rst:21 -msgid "" -"Text contains the specified value: :code:`Text(contains=\"text\") # " -"value in 'text'`" -msgstr "" -"Текст містить вказане значення: :code:`Text(contains=\"text\") # value " -"in 'text'`" - -#: ../../dispatcher/filters/text.rst:22 -msgid "" -"Any of previous listed filters can be list, set or tuple of strings " -"that's mean any of listed value should be " -"equals/startswith/endswith/contains: :code:`Text(text=[\"text\", " -"\"spam\"])`" -msgstr "" -"Будь-який із попередніх перерахованих фільтрів може бути списком, набором" -" або кортежем рядків, що означає, що будь-яке значення у списку має " -"дорівнювати/починатися/закінчуватися/містити: :code:`Text(text=[\"text\"," -" \"spam\"])`" - -#: ../../dispatcher/filters/text.rst:23 -msgid "" -"Ignore case can be combined with any previous listed filter: " -":code:`Text(text=\"Text\", ignore_case=True) # value.lower() == " -"'text'.lower()`" -msgstr "" -"Ігнорування регістру можна поєднати з будь-яким фільтром із попереднього " -"списку: :code:`Text(text=\"Text\", ignore_case=True) # value.lower() == " -"'text'.lower()`" - -#: ../../dispatcher/filters/text.rst:26 -msgid "Allowed handlers" -msgstr "Дозволені обробники (handlers)" - -#: ../../dispatcher/filters/text.rst:28 -msgid "Allowed update types for this filter:" -msgstr "Дозволені типи оновлень для цього фільтра:" - -#: ../../dispatcher/filters/text.rst:30 -msgid ":code:`message`" -msgstr ":code:`message`" - -#: ../../dispatcher/filters/text.rst:31 -msgid ":code:`edited_message`" -msgstr ":code:`edited_message`" - -#: ../../dispatcher/filters/text.rst:32 -msgid ":code:`channel_post`" -msgstr ":code:`channel_post`" - -#: ../../dispatcher/filters/text.rst:33 -msgid ":code:`edited_channel_post`" -msgstr ":code:`edited_channel_post`" - -#: ../../dispatcher/filters/text.rst:34 -msgid ":code:`inline_query`" -msgstr ":code:`inline_query`" - -#: ../../dispatcher/filters/text.rst:35 -msgid ":code:`callback_query`" -msgstr ":code:`callback_query`"