Skip to content

Commit

Permalink
Update start.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lntechnical2 authored Apr 30, 2022
1 parent 6b10401 commit d887528
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions plugins/start.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pyrogram import Client, filters
from pyrogram.types import ( InlineKeyboardButton, InlineKeyboardMarkup,ForceReply)
import humanize
from helper.database import insert
from helper.database import insert ,find_one
from pyrogram.file_id import FileId
CHANNEL = os.environ.get("CAHNNEL", "")

Expand Down Expand Up @@ -29,14 +29,24 @@ async def send_doc(client,message):
except UserNotParticipant:
await message.reply_text("**__You are not subscribed my channel__** ",reply_to_message_id = message.message_id, reply_markup = InlineKeyboardMarkup([ [ InlineKeyboardButton("Support 🇮🇳" ,url=f"https://t.me/{update_channel}") ] ]))
return
media = await client.get_messages(message.chat.id,message.message_id)
file = media.document or media.video or media.audio
dcid = FileId.decode(file.file_id).dc_id
filename = file.file_name
filesize = humanize.naturalsize(file.file_size)
fileid = file.file_id
await message.reply_text(
f"""__What do you want me to do with this file?__\n**File Name** :- {filename}\n**File Size** :- {filesize}\n**Dc ID** :- {dcid} """
,reply_to_message_id = message.message_id,
reply_markup = InlineKeyboardMarkup([[ InlineKeyboardButton("📝 Rename ",callback_data = "rename")
,InlineKeyboardButton("Cancel✖️",callback_data = "cancel") ]]))
date = message.date
_used_date = find_one(user_id)
used_date = _used_date["date"]
c_time = time.time()
LIMIT = 240
then = used_date+ LIMIT
left = round(then - c_time)
conversion = datetime.timedelta(seconds=left)
ltime = str(conversion)
if left > 0:
await app.send_chat_action(message.chat.id, "typing")
await message.reply_text(f"```Sorry Dude am not only for YOU \n Flood control is active so please wait for {ltime}```",reply_to_message_id = message.message_id)
else:
used_date = find(int(message.chat.id))
media = await client.get_messages(message.chat.id,message.message_id)
file = media.document or media.video or media.audio
dcid = FileId.decode(file.file_id).dc_id
filename = file.file_name
filesize = humanize.naturalsize(file.file_size)
fileid = file.file_id
await message.reply_text(f"""__What do you want me to do with this file?__\n**File Name** :- {filename}\n**File Size** :- {filesize}\n**Dc ID** :- {dcid} """,reply_to_message_id = message.message_id,reply_markup = InlineKeyboardMarkup([[ InlineKeyboardButton("📝 Rename ",callback_data = "rename"),InlineKeyboardButton("Cancel✖️",callback_data = "cancel") ]]))

0 comments on commit d887528

Please sign in to comment.