Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elif status == 4:
- rj = random.randint(1, 2)
- if rj == 1:
- random_filename = f"randomimg_{random.randint(0, 10000000000000000000000000)}.jpg"
- dem_filename = f"result_{random.randint(0, 10000000000000000000000000)}.jpg"
- if text_lines >= 10 and pic_count >= 1:
- if message.peer_id not in dialogs or time.time() >= dialogs[message.peer_id]:
- print(message.from_id)
- print("ГЕНЕРИРУЕМ ПО КОМАНДЕ")
- with open(chat_path, encoding="utf8") as file:
- texts = file.read().splitlines()
- with open(picture_path, encoding="utf8") as file:
- pictures = file.read().splitlines()
- ll = random.randint(1, 12)
- if ll == 1:
- rndtxt = random.choice(texts)
- texts.remove(rndtxt)
- rndtxt2 = random.choice(texts)
- texts.remove(rndtxt2)
- if len(rndtxt) >= 30:
- rndtxt = rndtxt[:30]
- if len(rndtxt2) >= 30:
- rndtxt2 = rndtxt2[:30]
- photo1 = Image.open("mem.jpg")
- font = ImageFont.truetype("arialbd.ttf", size=30)
- idraw = ImageDraw.Draw(photo1)
- idraw.text((90, 5), rndtxt, font=font, fill='black')
- idraw.text((70, 82), rndtxt2, font=font, fill='black')
- photo1.save(dem_filename)
- photo = await photo_uploader.upload_message_photo(dem_filename)
- await message(attachment=photo)
- os.remove(dem_filename)
- dialogs[message.peer_id] = time.time() + 15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement