Skip to content

Commit cfdc664

Browse files
committed
2 parents 56e4c45 + bb4cfa3 commit cfdc664

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ async def main():
8989
file_path_1 = Path(__file__).parent.resolve().joinpath("test_photo_1.jpg")
9090
file_path_2 = Path(__file__).parent.resolve().joinpath("test_photo_2.jpg")
9191

92-
with InputFile(file_path_1) as file:
93-
with SendMediaGroup(
92+
with InputFile(file_path_1) as file: # You need to open files manually if you're using Path.
93+
with SendMediaGroup( # All sub files will be closed after this
9494
123456789,
9595
[
9696
InputMediaPhoto(file, "My first photo"),
97-
InputMediaPhoto(InputFile(open(file_path_2, "rb"), "test_photo_2.jpg")),
97+
InputMediaPhoto(InputFile(open(file_path_2, "rb"), "test_photo_2.jpg")), # Directly open and use file.
9898
InputMediaPhoto("https://imgur.com/t/funny/MpMGFRQ"),
9999
],
100100
) as send_media_group:

0 commit comments

Comments
 (0)