Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def get_data_from_link(api: API, link: str) -> BytesIO:
- return BytesIO(await api.http_client.request_content(link, "GET"))
- @bot.on.private_message()
- async def photo(message: Message):
- bytePicture = await get_data_from_link(bot.api, link="https://proprikol.ru/wp-content/uploads/2020/04/krasivye-kartinki-vysokogo-razresheniya-3.jpg")
- attachment = await PhotoMessageUploader(bot.api, generate_attachment_strings=True).upload(bytePicture)
- await message.answer("Моя картинка", attachment=attachment)
Advertisement
Add Comment
Please, Sign In to add comment