Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @dp.message_handler(state=Area.photo, content_types=types.ContentType.PHOTO)
- async def sale_photo_added_handler(message: types.Message, state: FSMContext):
- user = message.from_user.id
- recieved_text = message.text
- try:
- count = len(os.listdir(os.getcwd()+"\\Users\\" + str(user)))
- except Exception as e:
- count = 0
- photo = await bot.get_file(message.photo[-1].file_id)
- await photo.download(os.getcwd()+"\\Users\\" + str(user)+"\\{}.jpg".format(count+1))
Add Comment
Please, Sign In to add comment