Skip to content

Commit ce0fa69

Browse files
committed
Revert "refactor(message): remove automatic reply_parameters initialization"
This reverts commit 9d17b68.
1 parent 9d17b68 commit ce0fa69

1 file changed

Lines changed: 106 additions & 0 deletions

File tree

pyrogram/types/messages_and_media/message.py

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
log = logging.getLogger(__name__)
3535

36+
3637
class Str(str):
3738
def __init__(self, *args):
3839
super().__init__()
@@ -2107,6 +2108,11 @@ async def reply_animation(
21072108
Raises:
21082109
RPCError: In case of a Telegram RPC error.
21092110
"""
2111+
if reply_parameters is None:
2112+
reply_parameters = types.ReplyParameters(
2113+
message_id=self.id
2114+
)
2115+
21102116
if quote is not None:
21112117
log.warning(
21122118
"`quote` parameter is deprecated and will be removed in future updates."
@@ -2484,6 +2490,11 @@ async def reply_audio(
24842490
Raises:
24852491
RPCError: In case of a Telegram RPC error.
24862492
"""
2493+
if reply_parameters is None:
2494+
reply_parameters = types.ReplyParameters(
2495+
message_id=self.id
2496+
)
2497+
24872498
if quote is not None:
24882499
log.warning(
24892500
"`quote` parameter is deprecated and will be removed in future updates."
@@ -2789,6 +2800,11 @@ async def reply_contact(
27892800
Raises:
27902801
RPCError: In case of a Telegram RPC error.
27912802
"""
2803+
if reply_parameters is None:
2804+
reply_parameters = types.ReplyParameters(
2805+
message_id=self.id
2806+
)
2807+
27922808
if quote is not None:
27932809
log.warning(
27942810
"`quote` parameter is deprecated and will be removed in future updates."
@@ -3079,6 +3095,11 @@ async def reply_document(
30793095
Raises:
30803096
RPCError: In case of a Telegram RPC error.
30813097
"""
3098+
if reply_parameters is None:
3099+
reply_parameters = types.ReplyParameters(
3100+
message_id=self.id
3101+
)
3102+
30823103
if quote is not None:
30833104
log.warning(
30843105
"`quote` parameter is deprecated and will be removed in future updates."
@@ -3366,6 +3387,11 @@ async def reply_game(
33663387
Raises:
33673388
RPCError: In case of a Telegram RPC error.
33683389
"""
3390+
if reply_parameters is None:
3391+
reply_parameters = types.ReplyParameters(
3392+
message_id=self.id
3393+
)
3394+
33693395
if quote is not None:
33703396
log.warning(
33713397
"`quote` parameter is deprecated and will be removed in future updates."
@@ -3632,6 +3658,11 @@ async def reply_invoice(
36323658
Returns:
36333659
:obj:`~pyrogram.types.Message`: On success, the sent invoice message is returned.
36343660
"""
3661+
if reply_parameters is None:
3662+
reply_parameters = types.ReplyParameters(
3663+
message_id=self.id
3664+
)
3665+
36353666
if message_thread_id is None:
36363667
message_thread_id = self.message_thread_id
36373668

@@ -3982,6 +4013,11 @@ async def reply_location(
39824013
Raises:
39834014
RPCError: In case of a Telegram RPC error.
39844015
"""
4016+
if reply_parameters is None:
4017+
reply_parameters = types.ReplyParameters(
4018+
message_id=self.id
4019+
)
4020+
39854021
if quote is not None:
39864022
log.warning(
39874023
"`quote` parameter is deprecated and will be removed in future updates."
@@ -4203,6 +4239,11 @@ async def reply_media_group(
42034239
Raises:
42044240
RPCError: In case of a Telegram RPC error.
42054241
"""
4242+
if reply_parameters is None:
4243+
reply_parameters = types.ReplyParameters(
4244+
message_id=self.id
4245+
)
4246+
42064247
if quote is not None:
42074248
log.warning(
42084249
"`quote` parameter is deprecated and will be removed in future updates."
@@ -4422,6 +4463,11 @@ async def reply(
44224463
Raises:
44234464
RPCError: In case of a Telegram RPC error.
44244465
"""
4466+
if reply_parameters is None:
4467+
reply_parameters = types.ReplyParameters(
4468+
message_id=self.id
4469+
)
4470+
44254471
if quote is not None:
44264472
log.warning(
44274473
"`quote` parameter is deprecated and will be removed in future updates."
@@ -4746,6 +4792,11 @@ async def reply_photo(
47464792
Raises:
47474793
RPCError: In case of a Telegram RPC error.
47484794
"""
4795+
if reply_parameters is None:
4796+
reply_parameters = types.ReplyParameters(
4797+
message_id=self.id
4798+
)
4799+
47494800
if quote is not None:
47504801
log.warning(
47514802
"`quote` parameter is deprecated and will be removed in future updates."
@@ -5126,6 +5177,11 @@ async def reply_poll(
51265177
Raises:
51275178
RPCError: In case of a Telegram RPC error.
51285179
"""
5180+
if reply_parameters is None:
5181+
reply_parameters = types.ReplyParameters(
5182+
message_id=self.id
5183+
)
5184+
51295185
if quote is not None:
51305186
log.warning(
51315187
"`quote` parameter is deprecated and will be removed in future updates."
@@ -5437,6 +5493,11 @@ async def reply_dice(
54375493
Returns:
54385494
:obj:`~pyrogram.types.Message`: On success, the sent dice message is returned.
54395495
"""
5496+
if reply_parameters is None:
5497+
reply_parameters = types.ReplyParameters(
5498+
message_id=self.id
5499+
)
5500+
54405501
if message_thread_id is None:
54415502
message_thread_id = self.message_thread_id
54425503

@@ -5690,6 +5751,11 @@ async def reply_sticker(
56905751
Raises:
56915752
RPCError: In case of a Telegram RPC error.
56925753
"""
5754+
if reply_parameters is None:
5755+
reply_parameters = types.ReplyParameters(
5756+
message_id=self.id
5757+
)
5758+
56935759
if quote is not None:
56945760
log.warning(
56955761
"`quote` parameter is deprecated and will be removed in future updates."
@@ -5983,6 +6049,11 @@ async def reply_venue(
59836049
Raises:
59846050
RPCError: In case of a Telegram RPC error.
59856051
"""
6052+
if reply_parameters is None:
6053+
reply_parameters = types.ReplyParameters(
6054+
message_id=self.id
6055+
)
6056+
59866057
if quote is not None:
59876058
log.warning(
59886059
"`quote` parameter is deprecated and will be removed in future updates."
@@ -6323,6 +6394,11 @@ async def reply_video(
63236394
Raises:
63246395
RPCError: In case of a Telegram RPC error.
63256396
"""
6397+
if reply_parameters is None:
6398+
reply_parameters = types.ReplyParameters(
6399+
message_id=self.id
6400+
)
6401+
63266402
if quote is not None:
63276403
log.warning(
63286404
"`quote` parameter is deprecated and will be removed in future updates."
@@ -6737,6 +6813,11 @@ async def reply_video_note(
67376813
Raises:
67386814
RPCError: In case of a Telegram RPC error.
67396815
"""
6816+
if reply_parameters is None:
6817+
reply_parameters = types.ReplyParameters(
6818+
message_id=self.id
6819+
)
6820+
67406821
if quote is not None:
67416822
log.warning(
67426823
"`quote` parameter is deprecated and will be removed in future updates."
@@ -7081,6 +7162,11 @@ async def reply_voice(
70817162
Raises:
70827163
RPCError: In case of a Telegram RPC error.
70837164
"""
7165+
if reply_parameters is None:
7166+
reply_parameters = types.ReplyParameters(
7167+
message_id=self.id
7168+
)
7169+
70847170
if quote is not None:
70857171
log.warning(
70867172
"`quote` parameter is deprecated and will be removed in future updates."
@@ -7356,6 +7442,11 @@ async def reply_paid_media(
73567442
Returns:
73577443
List of :obj:`~pyrogram.types.Message`: On success, a list of messages is returned.
73587444
"""
7445+
if reply_parameters is None:
7446+
reply_parameters = types.ReplyParameters(
7447+
message_id=self.id
7448+
)
7449+
73597450
if direct_messages_topic_id is None:
73607451
direct_messages_topic_id = self.direct_messages_topic_id
73617452

@@ -7556,6 +7647,11 @@ async def reply_cached_media(
75567647
Raises:
75577648
RPCError: In case of a Telegram RPC error.
75587649
"""
7650+
if reply_parameters is None:
7651+
reply_parameters = types.ReplyParameters(
7652+
message_id=self.id
7653+
)
7654+
75597655
if quote is not None:
75607656
log.warning(
75617657
"`quote` parameter is deprecated and will be removed in future updates."
@@ -7793,6 +7889,11 @@ async def reply_inline_bot_result(
77937889
Raises:
77947890
RPCError: In case of a Telegram RPC error.
77957891
"""
7892+
if reply_parameters is None:
7893+
reply_parameters = types.ReplyParameters(
7894+
message_id=self.id
7895+
)
7896+
77967897
if quote is not None:
77977898
log.warning(
77987899
"`quote` parameter is deprecated and will be removed in future updates."
@@ -7966,6 +8067,11 @@ async def reply_checklist(
79668067
Raises:
79678068
RPCError: In case of a Telegram RPC error.
79688069
"""
8070+
if reply_parameters is None:
8071+
reply_parameters = types.ReplyParameters(
8072+
message_id=self.id
8073+
)
8074+
79698075
if quote is not None:
79708076
log.warning(
79718077
"`quote` parameter is deprecated and will be removed in future updates."

0 commit comments

Comments
 (0)