Skip to content

Commit 2c16a40

Browse files
chore: change return types in docstrings
1 parent 5752af6 commit 2c16a40

12 files changed

+33
-31
lines changed

hydrogram/handlers/callback_query_handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#
1717
# You should have received a copy of the GNU Lesser General Public License
1818
# along with Hydrogram. If not, see <http://www.gnu.org/licenses/>.
19+
1920
from asyncio import iscoroutinefunction
2021
from typing import Callable, Tuple
2122

hydrogram/handlers/message_handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#
1717
# You should have received a copy of the GNU Lesser General Public License
1818
# along with Hydrogram. If not, see <http://www.gnu.org/licenses/>.
19+
1920
from inspect import iscoroutinefunction
2021
from typing import Callable
2122

hydrogram/methods/pyromod/ask.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ async def ask(
4444
4545
:param chat_id: The chat ID(s) to wait for a message from. The first chat ID will be used to send the message.
4646
:param text: The text to send.
47-
:param filters: Same as :meth:`pyromod.types.Client.listen`.
48-
:param listener_type: Same as :meth:`pyromod.types.Client.listen`.
49-
:param timeout: Same as :meth:`pyromod.types.Client.listen`.
50-
:param unallowed_click_alert: Same as :meth:`pyromod.types.Client.listen`.
51-
:param user_id: Same as :meth:`pyromod.types.Client.listen`.
52-
:param message_id: Same as :meth:`pyromod.types.Client.listen`.
53-
:param inline_message_id: Same as :meth:`pyromod.types.Client.listen`.
47+
:param filters: Same as :meth:`hydrogram.Client.listen`.
48+
:param listener_type: Same as :meth:`hydrogram.Client.listen`.
49+
:param timeout: Same as :meth:`hydrogram.Client.listen`.
50+
:param unallowed_click_alert: Same as :meth:`hydrogram.Client.listen`.
51+
:param user_id: Same as :meth:`hydrogram.Client.listen`.
52+
:param message_id: Same as :meth:`hydrogram.Client.listen`.
53+
:param inline_message_id: Same as :meth:`hydrogram.Client.listen`.
5454
:param args: Additional arguments to pass to :meth:`hydrogram.Client.send_message`.
5555
:param kwargs: Additional keyword arguments to pass to :meth:`hydrogram.Client.send_message`.
5656
:return:
57-
Same as :meth:`pyromod.types.Client.listen`. The sent message is returned as the attribute ``sent_message``.
57+
Same as :meth:`hydrogram.Client.listen`. The sent message is returned as the attribute ``sent_message``.
5858
"""
5959
sent_message = None
6060
if text.strip() != "":

hydrogram/methods/pyromod/get_listener_matching_with_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def get_listener_matching_with_data(
3030
"""
3131
Gets a listener that matches the given data.
3232
33-
:param data: A :class:`pyromod.types.Identifier` to match against.
34-
:param listener_type: The type of listener to get. Must be a value from :class:`pyromod.types.ListenerTypes`.
33+
:param data: A :class:`hydrogram.types.Identifier` to match against.
34+
:param listener_type: The type of listener to get. Must be a value from :class:`hydrogram.types.ListenerTypes`.
3535
:return: The listener that matches the given data or ``None`` if no listener matches.
3636
"""
3737
matching = [

hydrogram/methods/pyromod/get_listener_matching_with_identifier_pattern.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ def get_listener_matching_with_identifier_pattern(
3030
"""
3131
Gets a listener that matches the given identifier pattern.
3232
33-
The difference from :meth:`pyromod.types.Client.get_listener_matching_with_data` is that this method
33+
The difference from :meth:`hydrogram.Client.get_listener_matching_with_data` is that this method
3434
intends to get a listener by passing partial info of the listener identifier, while the other method
3535
intends to get a listener by passing the full info of the update data, which the listener should match with.
3636
37-
:param pattern: A :class:`pyromod.types.Identifier` to match against.
38-
:param listener_type: The type of listener to get. Must be a value from :class:`pyromod.types.ListenerTypes`.
37+
:param pattern: A :class:`hydrogram.types.Identifier` to match against.
38+
:param listener_type: The type of listener to get. Must be a value from :class:`hydrogram.types.ListenerTypes`.
3939
:return: The listener that matches the given identifier pattern or ``None`` if no listener matches.
4040
"""
4141
matching = [

hydrogram/methods/pyromod/get_many_listeners_matching_with_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ def get_many_listeners_matching_with_data(
3030
listener_type: ListenerTypes,
3131
) -> List[Listener]:
3232
"""
33-
Same of :meth:`pyromod.types.Client.get_listener_matching_with_data` but returns a list of listeners instead of one.
33+
Same of :meth:`hydrogram.Client.get_listener_matching_with_data` but returns a list of listeners instead of one.
3434
35-
:param data: Same as :meth:`pyromod.types.Client.get_listener_matching_with_data`.
36-
:param listener_type: Same as :meth:`pyromod.types.Client.get_listener_matching_with_data`.
35+
:param data: Same as :meth:`hydrogram.Client.get_listener_matching_with_data`.
36+
:param listener_type: Same as :meth:`hydrogram.Client.get_listener_matching_with_data`.
3737
:return: A list of listeners that match the given data.
3838
"""
3939
return [

hydrogram/methods/pyromod/get_many_listeners_matching_with_identifier_pattern.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ def get_many_listeners_matching_with_identifier_pattern(
3030
listener_type: ListenerTypes,
3131
) -> List[Listener]:
3232
"""
33-
Same of :meth:`pyromod.types.Client.get_listener_matching_with_identifier_pattern` but returns a list of listeners instead of one.
33+
Same of :meth:`hydrogram.Client.get_listener_matching_with_identifier_pattern` but returns a list of listeners instead of one.
3434
35-
:param pattern: Same as :meth:`pyromod.types.Client.get_listener_matching_with_identifier_pattern`.
36-
:param listener_type: Same as :meth:`pyromod.types.Client.get_listener_matching_with_identifier_pattern`.
35+
:param pattern: Same as :meth:`hydrogram.Client.get_listener_matching_with_identifier_pattern`.
36+
:param listener_type: Same as :meth:`hydrogram.Client.get_listener_matching_with_identifier_pattern`.
3737
:return: A list of listeners that match the given identifier pattern.
3838
"""
3939
return [

hydrogram/methods/pyromod/listen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async def listen(
4646
Creates a listener and waits for it to be fulfilled.
4747
4848
:param filters: A filter to check if the listener should be fulfilled.
49-
:param listener_type: The type of listener to create. Defaults to :attr:`pyromod.types.ListenerTypes.MESSAGE`.
49+
:param listener_type: The type of listener to create. Defaults to :attr:`hydrogram.types.ListenerTypes.MESSAGE`.
5050
:param timeout: The maximum amount of time to wait for the listener to be fulfilled. Defaults to ``None``.
5151
:param unallowed_click_alert: Whether to alert the user if they click on a button that is not intended for them. Defaults to ``True``.
5252
:param chat_id: The chat ID(s) to listen for. Defaults to ``None``.

hydrogram/methods/pyromod/register_next_step_handler.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ def register_next_step_handler(
4040
Registers a listener with a callback to be called when the listener is fulfilled.
4141
4242
:param callback: The callback to call when the listener is fulfilled.
43-
:param filters: Same as :meth:`pyromod.types.Client.listen`.
44-
:param listener_type: Same as :meth:`pyromod.types.Client.listen`.
45-
:param unallowed_click_alert: Same as :meth:`pyromod.types.Client.listen`.
46-
:param chat_id: Same as :meth:`pyromod.types.Client.listen`.
47-
:param user_id: Same as :meth:`pyromod.types.Client.listen`.
48-
:param message_id: Same as :meth:`pyromod.types.Client.listen`.
49-
:param inline_message_id: Same as :meth:`pyromod.types.Client.listen`.
43+
:param filters: Same as :meth:`hydrogram.Client.listen`.
44+
:param listener_type: Same as :meth:`hydrogram.Client.listen`.
45+
:param unallowed_click_alert: Same as :meth:`hydrogram.Client.listen`.
46+
:param chat_id: Same as :meth:`hydrogram.Client.listen`.
47+
:param user_id: Same as :meth:`hydrogram.Client.listen`.
48+
:param message_id: Same as :meth:`hydrogram.Client.listen`.
49+
:param inline_message_id: Same as :meth:`hydrogram.Client.listen`.
5050
:return: ``void``
5151
"""
5252
pattern = Identifier(

hydrogram/methods/pyromod/remove_listener.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
class RemoveListener:
2727
def remove_listener(self: "hydrogram.Client", listener: Listener):
2828
"""
29-
Removes a listener from the :meth:`pyromod.types.Client.listeners` dictionary.
29+
Removes a listener from the :meth:`hydrogram.Client.listeners` dictionary.
3030
3131
:param listener: The listener to remove.
3232
:return: ``void``

0 commit comments

Comments
 (0)