|
@@ -11,9 +11,9 @@ __HELP__ = "/paste - To Paste Replied Text Or Document To Neokobin"
|
|
|
@app.on_message(filters.command("paste") & ~filters.edited)
|
|
@app.on_message(filters.command("paste") & ~filters.edited)
|
|
|
@capture_err
|
|
@capture_err
|
|
|
async def paste(_, message):
|
|
async def paste(_, message):
|
|
|
- if bool(message.reply_to_message) is True:
|
|
|
|
|
|
|
+ if message.reply_to_message:
|
|
|
app.set_parse_mode("markdown")
|
|
app.set_parse_mode("markdown")
|
|
|
- if bool(message.reply_to_message.text) is True:
|
|
|
|
|
|
|
+ if message.reply_to_message.text:
|
|
|
m = await message.reply_text("```Pasting To Nekobin...```")
|
|
m = await message.reply_text("```Pasting To Nekobin...```")
|
|
|
message_get = message.reply_to_message.text
|
|
message_get = message.reply_to_message.text
|
|
|
message_as_str = str(message_get)
|
|
message_as_str = str(message_get)
|
|
@@ -21,7 +21,10 @@ async def paste(_, message):
|
|
|
final_link = f"[Nekobin]({paste_link})"
|
|
final_link = f"[Nekobin]({paste_link})"
|
|
|
await m.edit(final_link, disable_web_page_preview=True)
|
|
await m.edit(final_link, disable_web_page_preview=True)
|
|
|
|
|
|
|
|
- elif bool(message.reply_to_message.document) is True:
|
|
|
|
|
|
|
+ elif message.reply_to_message.document:
|
|
|
|
|
+ if message.reply_to_message.document.file_size > 300000:
|
|
|
|
|
+ await message.reply_text("You can only paste files smaller than 300KB.")
|
|
|
|
|
+ return
|
|
|
m = await message.reply_text("```Pasting To Nekobin...```")
|
|
m = await message.reply_text("```Pasting To Nekobin...```")
|
|
|
await message.reply_to_message.download(file_name='paste.txt')
|
|
await message.reply_to_message.download(file_name='paste.txt')
|
|
|
i = open("downloads/paste.txt", "r")
|
|
i = open("downloads/paste.txt", "r")
|
|
@@ -29,8 +32,5 @@ async def paste(_, message):
|
|
|
os.remove('downloads/paste.txt')
|
|
os.remove('downloads/paste.txt')
|
|
|
final_link = f"[Nekobin]({paste_link})"
|
|
final_link = f"[Nekobin]({paste_link})"
|
|
|
await m.edit(final_link, disable_web_page_preview=True)
|
|
await m.edit(final_link, disable_web_page_preview=True)
|
|
|
- elif bool(message.reply_to_message) is False:
|
|
|
|
|
- await message.reply_text(
|
|
|
|
|
- "Reply To A Message With /paste, Just Hitting /paste "
|
|
|
|
|
- + "Won't Do Anything Other Than Proving Everyone That "
|
|
|
|
|
- + "You Are A Spammer Who Is Obsessed To 'BlueTextMustClickofobia")
|
|
|
|
|
|
|
+ else:
|
|
|
|
|
+ await message.reply_text("Reply To A Message With /paste")
|