Skip to content

Commit 0a8a3fb

Browse files
fix: venue copy with empty foursquare_id
1 parent 5aae094 commit 0a8a3fb

1 file changed

Lines changed: 8 additions & 18 deletions

File tree

pyrogram/types/messages_and_media/message.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8772,7 +8772,7 @@ async def copy(
87728772
longitude=self.venue.location.longitude,
87738773
title=self.venue.title,
87748774
address=self.venue.address,
8775-
foursquare_id=self.venue.foursquare_id,
8775+
foursquare_id=self.venue.foursquare_id or "",
87768776
foursquare_type=self.venue.foursquare_type,
87778777
disable_notification=disable_notification,
87788778
message_thread_id=message_thread_id,
@@ -8817,23 +8817,13 @@ async def copy(
88178817
else:
88188818
raise ValueError("Unknown media type")
88198819

8820-
if self.sticker or self.video_note: # Sticker and VideoNote should have no caption
8821-
return await send_media(
8822-
file_id=file_id,
8823-
message_thread_id=message_thread_id
8824-
)
8825-
else:
8826-
if caption is None:
8827-
caption = self.caption or ""
8828-
caption_entities = self.caption_entities
8829-
8830-
return await send_media(
8831-
file_id=file_id,
8832-
caption=caption,
8833-
parse_mode=parse_mode,
8834-
caption_entities=caption_entities,
8835-
message_thread_id=message_thread_id
8836-
)
8820+
return await send_media(
8821+
file_id=file_id,
8822+
caption=self.caption or "",
8823+
parse_mode=parse_mode,
8824+
caption_entities=self.caption_entities,
8825+
message_thread_id=message_thread_id
8826+
)
88378827
else:
88388828
raise ValueError("Can't copy this message")
88398829

0 commit comments

Comments
 (0)