Advertisement
l1von

df

Feb 1st, 2021
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1.                         if ll == 2:
  2.                             with open(picture_path, encoding="utf8") as file:
  3.                                 pictures = file.read().splitlines()
  4.                             rndpic = random.choice(pictures)
  5.                             p = requests.get(rndpic)
  6.                             out = open(random_filename, "wb")
  7.                             out.write(p.content)
  8.                             out.close()
  9.                             rndpic = random.choice(pictures)
  10.                             photo1 = Image.open("10.jpg")
  11.                             user_img = Image.open(random_filename).convert("RGBA").resize((175, 108))
  12.                             photo1.paste(user_img, (118, 10))
  13.                             photo1.save(dem_filename)
  14.                             photo2 = Image.open("10.jpg")
  15.                             user_img2 = Image.open(random_filename).convert("RGBA").resize((175, 108))
  16.                             photo2.paste(user_img2, (118, 122))
  17.                             photo2.save(dem_filename)
  18.                             photo = await photo_uploader.upload_message_photo(dem_filename)
  19.                             await message(attachment=photo)
  20.                             os.remove(dem_filename)
  21.                             os.remove(random_filename)
  22.                             dialogs[message.peer_id] = time.time() + 15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement