Skip to content

Commit c7476f2

Browse files
authored
Fix condition check in bound methods
Closes TelegramPlayground#70 Regression was introduced in 47e1ce2 and 6f628d7
1 parent 6acddb5 commit c7476f2

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

pyrogram/types/messages_and_media/message.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3869,7 +3869,7 @@ async def reply_invoice(
38693869
payload=payload,
38703870
currency=currency,
38713871
prices=prices,
3872-
message_thread_id=message_thread_id or self.message_thread_id,
3872+
message_thread_id=self.message_thread_id if message_thread_id is None else message_thread_id,
38733873
provider_token=provider_token,
38743874
max_tip_amount=max_tip_amount,
38753875
suggested_tip_amounts=suggested_tip_amounts,
@@ -3887,7 +3887,7 @@ async def reply_invoice(
38873887
send_email_to_provider=send_email_to_provider,
38883888
is_flexible=is_flexible,
38893889
disable_notification=disable_notification,
3890-
protect_content=protect_content or self.has_protected_content,
3890+
protect_content=self.has_protected_content if protect_content is None else protect_content,
38913891
message_effect_id=message_effect_id or self.effect_id,
38923892
reply_parameters=reply_parameters,
38933893
reply_markup=reply_markup,
@@ -4334,14 +4334,14 @@ async def copy(
43344334
elif self.text:
43354335
return await self._client.send_message(
43364336
chat_id=chat_id,
4337-
message_thread_id=message_thread_id or self.message_thread_id,
4338-
business_connection_id=business_connection_id or self.business_connection_id,
4337+
message_thread_id=self.message_thread_id if message_thread_id is None else message_thread_id,
4338+
business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id,
43394339
text=self.text,
43404340
parse_mode=enums.ParseMode.DISABLED,
43414341
entities=self.entities,
43424342
link_preview_options=self.link_preview_options,
43434343
disable_notification=disable_notification,
4344-
protect_content=protect_content or self.has_protected_content,
4344+
protect_content=self.has_protected_content if protect_content is None else protect_content,
43454345
message_effect_id=self.effect_id,
43464346
reply_parameters=reply_parameters,
43474347
reply_markup=self.reply_markup if reply_markup is object else reply_markup,
@@ -4356,10 +4356,10 @@ async def copy(
43564356
message_effect_id=self.effect_id,
43574357
show_caption_above_media=show_caption_above_media or self.show_caption_above_media,
43584358
reply_parameters=reply_parameters,
4359-
message_thread_id=message_thread_id or self.message_thread_id,
4360-
business_connection_id=business_connection_id or self.business_connection_id,
4359+
message_thread_id=self.message_thread_id if message_thread_id is None else message_thread_id,
4360+
business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id,
43614361
schedule_date=schedule_date,
4362-
protect_content=protect_content or self.has_protected_content,
4362+
protect_content=self.has_protected_content if protect_content is None else protect_content,
43634363
has_spoiler=self.has_media_spoiler,
43644364
reply_to_message_id=reply_to_message_id,
43654365
reply_markup=self.reply_markup if reply_markup is object else reply_markup
@@ -4391,10 +4391,10 @@ async def copy(
43914391
disable_notification=disable_notification,
43924392
message_effect_id=self.effect_id,
43934393
reply_parameters=reply_parameters,
4394-
message_thread_id=message_thread_id or self.message_thread_id,
4395-
business_connection_id=business_connection_id or self.business_connection_id,
4394+
message_thread_id=self.message_thread_id if message_thread_id is None else message_thread_id,
4395+
business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id,
43964396
schedule_date=schedule_date,
4397-
protect_content=protect_content or self.has_protected_content,
4397+
protect_content=self.has_protected_content if protect_content is None else protect_content,
43984398
reply_to_message_id=reply_to_message_id,
43994399
reply_markup=self.reply_markup if reply_markup is object else reply_markup
44004400
)
@@ -4406,10 +4406,10 @@ async def copy(
44064406
disable_notification=disable_notification,
44074407
message_effect_id=self.effect_id,
44084408
reply_parameters=reply_parameters,
4409-
message_thread_id=message_thread_id or self.message_thread_id,
4410-
business_connection_id=business_connection_id or self.business_connection_id,
4409+
message_thread_id=self.message_thread_id if message_thread_id is None else message_thread_id,
4410+
business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id,
44114411
schedule_date=schedule_date,
4412-
protect_content=protect_content or self.has_protected_content,
4412+
protect_content=self.has_protected_content if protect_content is None else protect_content,
44134413
reply_to_message_id=reply_to_message_id,
44144414
reply_markup=self.reply_markup if reply_markup is object else reply_markup
44154415
)
@@ -4425,10 +4425,10 @@ async def copy(
44254425
disable_notification=disable_notification,
44264426
message_effect_id=self.effect_id,
44274427
reply_parameters=reply_parameters,
4428-
message_thread_id=message_thread_id or self.message_thread_id,
4429-
business_connection_id=business_connection_id or self.business_connection_id,
4428+
message_thread_id=self.message_thread_id if message_thread_id is None else message_thread_id,
4429+
business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id,
44304430
schedule_date=schedule_date,
4431-
protect_content=protect_content or self.has_protected_content,
4431+
protect_content=self.has_protected_content if protect_content is None else protect_content,
44324432
reply_to_message_id=reply_to_message_id,
44334433
reply_markup=self.reply_markup if reply_markup is object else reply_markup
44344434
)
@@ -4452,11 +4452,11 @@ async def copy(
44524452
open_period=self.poll.open_period,
44534453
close_date=self.poll.close_date,
44544454
disable_notification=disable_notification,
4455-
protect_content=protect_content or self.has_protected_content,
4455+
protect_content=self.has_protected_content if protect_content is None else protect_content,
44564456
message_effect_id=self.effect_id,
44574457
reply_parameters=reply_parameters,
4458-
message_thread_id=message_thread_id or self.message_thread_id,
4459-
business_connection_id=business_connection_id or self.business_connection_id,
4458+
message_thread_id=self.message_thread_id if message_thread_id is None else message_thread_id,
4459+
business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id,
44604460
schedule_date=schedule_date,
44614461
reply_to_message_id=reply_to_message_id,
44624462
reply_markup=self.reply_markup if reply_markup is object else reply_markup
@@ -4466,9 +4466,9 @@ async def copy(
44664466
chat_id,
44674467
game_short_name=self.game.short_name,
44684468
disable_notification=disable_notification,
4469-
protect_content=protect_content or self.has_protected_content,
4470-
message_thread_id=message_thread_id or self.message_thread_id,
4471-
business_connection_id=business_connection_id or self.business_connection_id,
4469+
protect_content=self.has_protected_content if protect_content is None else protect_content,
4470+
message_thread_id=self.message_thread_id if message_thread_id is None else message_thread_id,
4471+
business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id,
44724472
message_effect_id=self.effect_id,
44734473
reply_parameters=reply_parameters,
44744474
reply_to_message_id=reply_to_message_id,

0 commit comments

Comments
 (0)