Skip to content

Commit 108c331

Browse files
authored
Add reply_to_chat_id to copy_message (hydrogram#14)
1 parent 17b4108 commit 108c331

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

pyrogram/filters.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,17 @@ async def bot_filter(_, __, m: Message):
182182
"""Filter messages coming from bots."""
183183

184184

185+
# endregion
186+
187+
# region sender_chat_filter
188+
async def sender_chat_filter(_, __, m: Message):
189+
return bool(m.sender_chat)
190+
191+
192+
sender_chat = create(sender_chat_filter)
193+
"""Filter messages coming from sender chat."""
194+
195+
185196
# endregion
186197

187198
# region incoming_filter

pyrogram/methods/messages/copy_message.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ async def copy_message(
3838
disable_notification: bool = None,
3939
message_thread_id: int = None,
4040
reply_to_message_id: int = None,
41+
reply_to_chat_id: Union[int, str] = None,
4142
schedule_date: datetime = None,
4243
protect_content: bool = None,
4344
has_spoiler: bool = None,
@@ -91,6 +92,9 @@ async def copy_message(
9192
9293
reply_to_message_id (``int``, *optional*):
9394
If the message is a reply, ID of the original message.
95+
96+
reply_to_chat_id (``int``, *optional*):
97+
If the message is a reply, ID of the original chat.
9498
9599
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
96100
Date when the message will be automatically sent.
@@ -125,6 +129,7 @@ async def copy_message(
125129
disable_notification=disable_notification,
126130
message_thread_id=message_thread_id,
127131
reply_to_message_id=reply_to_message_id,
132+
reply_to_chat_id=reply_to_chat_id,
128133
schedule_date=schedule_date,
129134
protect_content=protect_content,
130135
has_spoiler=has_spoiler,

pyrogram/types/messages_and_media/message.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3714,6 +3714,7 @@ async def copy(
37143714
disable_notification=disable_notification,
37153715
message_thread_id=message_thread_id,
37163716
reply_to_message_id=reply_to_message_id,
3717+
reply_to_chat_id=reply_to_chat_id,
37173718
quote_text=quote_text,
37183719
quote_entities=quote_entities,
37193720
schedule_date=schedule_date,

0 commit comments

Comments
 (0)