Skip to content

Commit ef912d2

Browse files
committed
Use more concise and cleaner description of a method and a type
1 parent eadda55 commit ef912d2

129 files changed

Lines changed: 153 additions & 141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pyrogram/client/client.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def proxy(self, value):
261261
self._proxy.update(value)
262262

263263
def start(self):
264-
"""Use this method to start the Client.
264+
"""Start the Client.
265265
266266
Raises:
267267
RPCError: In case of a Telegram RPC error.
@@ -354,7 +354,7 @@ def start(self):
354354
return self
355355

356356
def stop(self):
357-
"""Use this method to stop the Client.
357+
"""Stop the Client.
358358
359359
Raises:
360360
ConnectionError: In case you try to stop an already stopped Client.
@@ -396,7 +396,7 @@ def stop(self):
396396
return self
397397

398398
def restart(self):
399-
"""Use this method to restart the Client.
399+
"""Restart the Client.
400400
401401
Raises:
402402
ConnectionError: In case you try to restart a stopped Client.
@@ -405,7 +405,7 @@ def restart(self):
405405
self.start()
406406

407407
def idle(self, stop_signals: tuple = (SIGINT, SIGTERM, SIGABRT)):
408-
"""Use this method to block the main script execution until a signal (e.g.: from CTRL+C) is received.
408+
"""Block the main script execution until a signal (e.g.: from CTRL+C) is received.
409409
Once the signal is received, the client will automatically stop and the main script will continue its execution.
410410
411411
This is used after starting one or more clients and is useful for event-driven applications only, that are,
@@ -438,7 +438,7 @@ def signal_handler(*args):
438438
self.stop()
439439

440440
def run(self):
441-
"""Use this method to start the Client and automatically idle the main script.
441+
"""Start the Client and automatically idle the main script.
442442
443443
This is a convenience method that literally just calls :meth:`start` and :meth:`idle`. It makes running a client
444444
less verbose, but is not suitable in case you want to run more than one client in a single main script,
@@ -451,7 +451,7 @@ def run(self):
451451
self.idle()
452452

453453
def add_handler(self, handler: Handler, group: int = 0):
454-
"""Use this method to register an update handler.
454+
"""Register an update handler.
455455
456456
You can register multiple handlers, but at most one handler within a group
457457
will be used for a single update. To handle the same update more than once, register
@@ -475,7 +475,7 @@ def add_handler(self, handler: Handler, group: int = 0):
475475
return handler, group
476476

477477
def remove_handler(self, handler: Handler, group: int = 0):
478-
"""Use this method to remove a previously-registered update handler.
478+
"""Remove a previously-registered update handler.
479479
480480
Make sure to provide the right group that the handler was added in. You can use
481481
the return value of the :meth:`add_handler` method, a tuple of (handler, group), and
@@ -494,7 +494,7 @@ def remove_handler(self, handler: Handler, group: int = 0):
494494
self.dispatcher.remove_handler(handler, group)
495495

496496
def stop_transmission(self):
497-
"""Use this method to stop downloading or uploading a file.
497+
"""Stop downloading or uploading a file.
498498
Must be called inside a progress callback function.
499499
"""
500500
raise Client.StopTransmission
@@ -1036,7 +1036,7 @@ def updates_worker(self):
10361036
log.debug("{} stopped".format(name))
10371037

10381038
def send(self, data: Object, retries: int = Session.MAX_RETRIES, timeout: float = Session.WAIT_TIMEOUT):
1039-
"""Use this method to send raw Telegram queries.
1039+
"""Send raw Telegram queries.
10401040
10411041
This method makes it possible to manually call every single Telegram API method in a low-level manner.
10421042
Available functions are listed in the :obj:`functions <pyrogram.api.functions>` package and may accept compound
@@ -1341,7 +1341,7 @@ def get_initial_dialogs(self):
13411341
self.get_initial_dialogs_chunk()
13421342

13431343
def resolve_peer(self, peer_id: Union[int, str]):
1344-
"""Use this method to get the InputPeer of a known peer id.
1344+
"""Get the InputPeer of a known peer id.
13451345
Useful whenever an InputPeer type is required.
13461346
13471347
.. note::
@@ -1423,7 +1423,7 @@ def save_file(
14231423
progress: callable = None,
14241424
progress_args: tuple = ()
14251425
):
1426-
"""Use this method to upload a file onto Telegram servers, without actually sending the message to anyone.
1426+
"""Upload a file onto Telegram servers, without actually sending the message to anyone.
14271427
Useful whenever an InputFile type is required.
14281428
14291429
.. note::

pyrogram/client/filters/filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
def create(name: str, func: callable, **kwargs) -> type:
26-
"""Use this method to create a Filter.
26+
"""Create a Filter.
2727
2828
Custom filters give you extra control over which updates are allowed or not to be processed by your handlers.
2929

pyrogram/client/methods/bots/answer_callback_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def answer_callback_query(
2929
url: str = None,
3030
cache_time: int = 0
3131
):
32-
"""Use this method to send answers to callback queries sent from inline keyboards.
32+
"""Send answers to callback queries sent from inline keyboards.
3333
The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
3434
3535
Parameters:

pyrogram/client/methods/bots/answer_inline_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def answer_inline_query(
3434
switch_pm_text: str = "",
3535
switch_pm_parameter: str = ""
3636
):
37-
"""Use this method to send answers to an inline query.
37+
"""Send answers to an inline query.
3838
No more than 50 results per query are allowed.
3939
4040
Parameters:

pyrogram/client/methods/bots/get_game_high_scores.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def get_game_high_scores(
3030
chat_id: Union[int, str],
3131
message_id: int = None
3232
) -> "pyrogram.GameHighScores":
33-
"""Use this method to get data for high score tables.
33+
"""Get data for high score tables.
3434
3535
Parameters:
3636
user_id (``int`` | ``str``):

pyrogram/client/methods/bots/get_inline_bot_results.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_inline_bot_results(
3232
latitude: float = None,
3333
longitude: float = None
3434
):
35-
"""Use this method to get bot results via inline queries.
35+
"""Get bot results via inline queries.
3636
You can then send a result using :obj:`send_inline_bot_result <pyrogram.Client.send_inline_bot_result>`
3737
3838
Parameters:

pyrogram/client/methods/bots/request_callback_answer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def request_callback_answer(
3030
callback_data: bytes,
3131
timeout: int = 10
3232
):
33-
"""Use this method to request a callback answer from bots.
33+
"""Request a callback answer from bots.
3434
This is the equivalent of clicking an inline button containing callback data.
3535
3636
Parameters:

pyrogram/client/methods/bots/send_game.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def send_game(
3737
"pyrogram.ForceReply"
3838
] = None
3939
) -> "pyrogram.Message":
40-
"""Use this method to send a game.
40+
"""Send a game.
4141
4242
Parameters:
4343
chat_id (``int`` | ``str``):

pyrogram/client/methods/bots/send_inline_bot_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def send_inline_bot_result(
3232
reply_to_message_id: int = None,
3333
hide_via: bool = None
3434
):
35-
"""Use this method to send an inline bot result.
35+
"""Send an inline bot result.
3636
Bot results can be retrieved using :obj:`get_inline_bot_results <pyrogram.Client.get_inline_bot_results>`
3737
3838
Parameters:

pyrogram/client/methods/bots/set_game_score.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def set_game_score(
3434
message_id: int = None
3535
):
3636
# inline_message_id: str = None): TODO Add inline_message_id
37-
"""Use this method to set the score of the specified user in a game.
37+
"""Set the score of the specified user in a game.
3838
3939
Parameters:
4040
user_id (``int`` | ``str``):

0 commit comments

Comments
 (0)