Переглянути джерело

Fixed userbot eval bug, Added custom name option in /pdf

TheHamkerCat 5 роки тому
батько
коміт
22cd717077
2 змінених файлів з 5 додано та 0 видалено
  1. 3 0
      wbb/modules/img_pdf.py
  2. 2 0
      wbb/modules/userbot.py

+ 3 - 0
wbb/modules/img_pdf.py

@@ -63,6 +63,9 @@ async def convert(
     pdf = BytesIO(img2pdf.convert(documents))
     pdf.name = "wbb.pdf"
 
+    if len(main_message.command) >= 2:
+        pdf.name = main_message.text.split(None, 1)[1]
+
     elapsed = round(time() - start_time, 2)
 
     await main_message.reply_document(

+ 2 - 0
wbb/modules/userbot.py

@@ -148,6 +148,8 @@ async def executor(client, message: Message):
             return await message.reply(final_output, quote=True)
         else:
             return
+    if not status.from_user:
+        status = await app2.get_messages(status.chat.id, status.message_id)
     await eor(status, text=final_output, quote=True)