Spaces:
Paused
Paused
JamesBond531
commited on
Commit
•
d3af495
1
Parent(s):
8b47596
Add second shortlink for file in button
Browse files- plugins/commands.py +37 -57
plugins/commands.py
CHANGED
@@ -14,7 +14,7 @@ from pyrogram.types import *
|
|
14 |
from database.ia_filterdb import *
|
15 |
from database.users_chats_db import db
|
16 |
from info import *
|
17 |
-
from utils import get_settings, get_size, is_subscribed, save_group_settings, temp, verify_user, check_token, check_verification, get_token, get_shortlink, get_tutorial
|
18 |
from database.connections_mdb import active_connection
|
19 |
# from plugins.pm_filter import ENABLE_SHORTLINK
|
20 |
from plugins.fsub import ForceSub
|
@@ -277,6 +277,7 @@ async def start(client, message):
|
|
277 |
chat_id = int("-" + file_id.split("-")[1])
|
278 |
user_id = message.from_user.id if message.from_user else None
|
279 |
if not await db.is_user_verified(user_id):
|
|
|
280 |
verify_id = ''.join(random.choices(string.ascii_uppercase + string.digits, k=7))
|
281 |
await db.create_verify_id(user_id, verify_id)
|
282 |
st = await client.get_chat_member(chat_id, user_id)
|
@@ -287,30 +288,22 @@ async def start(client, message):
|
|
287 |
g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=allfiles_{file_id}_{verify_id}", True)
|
288 |
else:
|
289 |
g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=allfiles_{file_id}_{verify_id}", False)
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
], [
|
297 |
-
InlineKeyboardButton('⁉️ Hᴏᴡ Tᴏ Dᴏᴡɴʟᴏᴀᴅ ⁉️', url=await get_tutorial(chat_id))
|
298 |
-
]
|
299 |
-
]
|
300 |
-
)
|
301 |
-
)
|
302 |
-
else:
|
303 |
-
await client.send_message(chat_id=message.from_user.id,text=f"<b>Get All Files in a Single Link!!!\n\n📂 ʟɪɴᴋ ➠ : {g}\n\n<i>Note: Open Link and Get Your File and also Get access for Unlimited files for next 2hrs without getting links in this bot</i></b>",
|
304 |
-
reply_markup=InlineKeyboardMarkup(
|
305 |
[
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
]
|
312 |
-
|
313 |
)
|
|
|
314 |
# await asyncio.sleep(300)
|
315 |
# await k.edit("<b>Your message is successfully deleted!!!</b>")
|
316 |
return
|
@@ -382,32 +375,25 @@ async def start(client, message):
|
|
382 |
files_ = await get_file_details(file_id)
|
383 |
files = files_[0]
|
384 |
if not await db.is_user_verified(user_id):
|
|
|
385 |
verify_id = ''.join(random.choices(string.ascii_uppercase + string.digits, k=7))
|
386 |
await db.create_verify_id(user_id, verify_id)
|
387 |
g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=file_{file_id}_{verify_id}")
|
388 |
if not g:
|
389 |
chat_id = '-1001714266146'
|
390 |
g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=file_{file_id}_{verify_id}")
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
[
|
396 |
-
InlineKeyboardButton('📂 Dᴏᴡɴʟᴏᴀᴅ Nᴏᴡ 📂', url=g)
|
397 |
-
], [
|
398 |
-
InlineKeyboardButton('⁉️ Hᴏᴡ Tᴏ Dᴏᴡɴʟᴏᴀᴅ ⁉️', url=await get_tutorial(chat_id))
|
399 |
-
]
|
400 |
-
]
|
401 |
-
)
|
402 |
-
)
|
403 |
-
else:
|
404 |
-
await client.send_message(chat_id=user_id,text=f"<b>📕Nᴀᴍᴇ ➠ : <code>{files.file_name}</code> \n\n🔗Sɪᴢᴇ ➠ : {get_size(files.file_size)}\n\n📂Fɪʟᴇ ʟɪɴᴋ ➠ : {g}\n\n<i>Note: Open Link and Get Your File and also Get access for Unlimited files for next 2hrs without getting links in this bot</i></b>",
|
405 |
reply_markup=InlineKeyboardMarkup(
|
406 |
[
|
407 |
[
|
408 |
InlineKeyboardButton('📂 Dᴏᴡɴʟᴏᴀᴅ Nᴏᴡ 📂', url=g)
|
409 |
], [
|
410 |
-
InlineKeyboardButton('
|
|
|
|
|
411 |
]
|
412 |
]
|
413 |
)
|
@@ -544,34 +530,28 @@ async def start(client, message):
|
|
544 |
chat_id = '-1001714266146'
|
545 |
settings = await get_settings(chat_id)
|
546 |
if settings['is_shortlink'] and user_id not in PREMIUM_USER and not await db.is_user_verified(user_id):
|
|
|
547 |
files_ = await get_file_details(file_id)
|
548 |
files = files_[0]
|
549 |
verify_id = ''.join(random.choices(string.ascii_uppercase + string.digits, k=7))
|
550 |
await db.create_verify_id(user_id, verify_id)
|
551 |
g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=file_{file_id}_{verify_id}")
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
InlineKeyboardButton('⁉️ Hᴏᴡ Tᴏ Dᴏᴡɴʟᴏᴀᴅ ⁉️', url=await get_tutorial(chat_id))
|
559 |
-
]
|
560 |
-
]
|
561 |
-
)
|
562 |
-
)
|
563 |
-
else:
|
564 |
-
await client.send_message(chat_id=user_id,text=f"<b>📕Nᴀᴍᴇ ➠ : <code>{files.file_name}</code> \n\n🔗Sɪᴢᴇ ➠ : {get_size(files.file_size)}\n\n📂Fɪʟᴇ ʟɪɴᴋ ➠ : {g}\n\n<i>Note: Open Link and Get Your File and also Get access for Unlimited files for next 2hrs without getting links in this bot</i></b>",
|
565 |
-
reply_markup=InlineKeyboardMarkup(
|
566 |
[
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
]
|
573 |
-
|
574 |
)
|
|
|
575 |
# await asyncio.sleep(1200)
|
576 |
# await k.edit("<b>Your message is successfully deleted!!!</b>")
|
577 |
return
|
|
|
14 |
from database.ia_filterdb import *
|
15 |
from database.users_chats_db import db
|
16 |
from info import *
|
17 |
+
from utils import get_settings, get_size, is_subscribed, save_group_settings, temp, verify_user, check_token, check_verification, get_token, get_shortlink, get_tutorial, second_shortlink
|
18 |
from database.connections_mdb import active_connection
|
19 |
# from plugins.pm_filter import ENABLE_SHORTLINK
|
20 |
from plugins.fsub import ForceSub
|
|
|
277 |
chat_id = int("-" + file_id.split("-")[1])
|
278 |
user_id = message.from_user.id if message.from_user else None
|
279 |
if not await db.is_user_verified(user_id):
|
280 |
+
m=await message.reply_text(f"<b><i> Link Generating...⏳</i></b>")
|
281 |
verify_id = ''.join(random.choices(string.ascii_uppercase + string.digits, k=7))
|
282 |
await db.create_verify_id(user_id, verify_id)
|
283 |
st = await client.get_chat_member(chat_id, user_id)
|
|
|
288 |
g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=allfiles_{file_id}_{verify_id}", True)
|
289 |
else:
|
290 |
g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=allfiles_{file_id}_{verify_id}", False)
|
291 |
+
tutorial = await get_tutorial(chat_id)
|
292 |
+
await m.edit_text("<b><i>Please Wait Sending to You...⚡️</i></b>")
|
293 |
+
h = await second_shortlink(g, f"https://telegram.me/{temp.U_NAME}?start=allfiles_{file_id}_{verify_id}")
|
294 |
+
await m.edit_text(text=f"<b>Get All Files in a Single Link!!!\n\n📂 ʟɪɴᴋ ➠ : {g}\n\n<i>Note: Open Link and Get Your File and also Get access for Unlimited files for next 2hrs without getting links in this bot</i></b>",
|
295 |
+
reply_markup=InlineKeyboardMarkup(
|
296 |
+
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
[
|
298 |
+
InlineKeyboardButton('📂 Dᴏᴡɴʟᴏᴀᴅ Nᴏᴡ 📂', url=g)
|
299 |
+
], [
|
300 |
+
InlineKeyboardButton('Nᴏᴛ Oᴘᴇɴ ᴏʀ Sᴛʀᴜᴄᴋ? Tʀʏ ᴛʜɪs 🔗', url=h)
|
301 |
+
],[
|
302 |
+
InlineKeyboardButton('⁉️ Hᴏᴡ Tᴏ Dᴏᴡɴʟᴏᴀᴅ ⁉️', url=tutorial)
|
303 |
]
|
304 |
+
]
|
305 |
)
|
306 |
+
)
|
307 |
# await asyncio.sleep(300)
|
308 |
# await k.edit("<b>Your message is successfully deleted!!!</b>")
|
309 |
return
|
|
|
375 |
files_ = await get_file_details(file_id)
|
376 |
files = files_[0]
|
377 |
if not await db.is_user_verified(user_id):
|
378 |
+
m=await message.reply_text(f"<b><i> Link Generating...⏳</i></b>")
|
379 |
verify_id = ''.join(random.choices(string.ascii_uppercase + string.digits, k=7))
|
380 |
await db.create_verify_id(user_id, verify_id)
|
381 |
g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=file_{file_id}_{verify_id}")
|
382 |
if not g:
|
383 |
chat_id = '-1001714266146'
|
384 |
g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=file_{file_id}_{verify_id}")
|
385 |
+
tutorial = await get_tutorial(chat_id)
|
386 |
+
await m.edit_text("<b><i>Please Wait Sending to You...⚡️</i></b>")
|
387 |
+
h = await second_shortlink(g, f"https://telegram.me/{temp.U_NAME}?start=file_{file_id}_{verify_id}")
|
388 |
+
await m.edit_text(text=f"<b>📕Nᴀᴍᴇ ➠ : <code>{files.file_name}</code> \n\n🔗Sɪᴢᴇ ➠ : {get_size(files.file_size)}\n\n📂Fɪʟᴇ ʟɪɴᴋ ➠ : {g}\n\n<i>Note: Open Link and Get Your File and also Get access for Unlimited files for next 2hrs without getting links in this bot</i></b>",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
reply_markup=InlineKeyboardMarkup(
|
390 |
[
|
391 |
[
|
392 |
InlineKeyboardButton('📂 Dᴏᴡɴʟᴏᴀᴅ Nᴏᴡ 📂', url=g)
|
393 |
], [
|
394 |
+
InlineKeyboardButton('Nᴏᴛ Oᴘᴇɴ ᴏʀ Sᴛʀᴜᴄᴋ? Tʀʏ ᴛʜɪs 🔗', url=h)
|
395 |
+
],[
|
396 |
+
InlineKeyboardButton('⁉️ Hᴏᴡ Tᴏ Dᴏᴡɴʟᴏᴀᴅ ⁉️', url=tutorial)
|
397 |
]
|
398 |
]
|
399 |
)
|
|
|
530 |
chat_id = '-1001714266146'
|
531 |
settings = await get_settings(chat_id)
|
532 |
if settings['is_shortlink'] and user_id not in PREMIUM_USER and not await db.is_user_verified(user_id):
|
533 |
+
m=await message.reply_text(f"<b><i> Link Generating...⏳</i></b>")
|
534 |
files_ = await get_file_details(file_id)
|
535 |
files = files_[0]
|
536 |
verify_id = ''.join(random.choices(string.ascii_uppercase + string.digits, k=7))
|
537 |
await db.create_verify_id(user_id, verify_id)
|
538 |
g = await get_shortlink(chat_id, f"https://telegram.me/{temp.U_NAME}?start=file_{file_id}_{verify_id}")
|
539 |
+
tutorial = await get_tutorial(chat_id)
|
540 |
+
await m.edit_text("<b><i>Please Wait Sending to You...⚡️</i></b>")
|
541 |
+
h = await second_shortlink(g, f"https://telegram.me/{temp.U_NAME}?start=file_{file_id}_{verify_id}")
|
542 |
+
await m.edit_text(text=f"<b>📕Nᴀᴍᴇ ➠ : <code>{files.file_name}</code> \n\n🔗Sɪᴢᴇ ➠ : {get_size(files.file_size)}\n\n📂Fɪʟᴇ ʟɪɴᴋ ➠ : {g}\n\n<i>Note: Open Link and Get Your File and also Get access for Unlimited files for next 2hrs without getting links in this bot</i></b>",
|
543 |
+
reply_markup=InlineKeyboardMarkup(
|
544 |
+
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
545 |
[
|
546 |
+
InlineKeyboardButton('📂 Dᴏᴡɴʟᴏᴀᴅ Nᴏᴡ 📂', url=g)
|
547 |
+
], [
|
548 |
+
InlineKeyboardButton('Nᴏᴛ Oᴘᴇɴ ᴏʀ Sᴛʀᴜᴄᴋ? Tʀʏ ᴛʜɪs 🔗', url=h)
|
549 |
+
],[
|
550 |
+
InlineKeyboardButton('⁉️ Hᴏᴡ Tᴏ Dᴏᴡɴʟᴏᴀᴅ ⁉️', url=tutorial)
|
551 |
]
|
552 |
+
]
|
553 |
)
|
554 |
+
)
|
555 |
# await asyncio.sleep(1200)
|
556 |
# await k.edit("<b>Your message is successfully deleted!!!</b>")
|
557 |
return
|