Skip to content

Commit e5b71dc

Browse files
authored
Update start.py
1 parent bffe3cf commit e5b71dc

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

plugins/start.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pyrogram.errors import FloodWait
77

88
from bot import Bot
9-
from config import ADMINS, START_MSG, OWNER_ID
9+
from config import ADMINS, START_MSG, OWNER_ID, CUSTOM_CAPTION, DISABLE_CHANNEL_BUTTON
1010
from helper_func import subscribed, encode, decode, get_messages
1111

1212
@Bot.on_message(filters.command('start') & filters.private & subscribed)
@@ -47,13 +47,25 @@ async def start_command(client: Client, message: Message):
4747
await message.reply_text("Something went wrong..!")
4848
return
4949
await temp_msg.delete()
50+
5051
for msg in messages:
52+
53+
if bool(CUSTOM_CAPTION) & bool(msg.document):
54+
caption = CUSTOM_CAPTION.format(previouscaption = msg.caption, filename = msg.document.file_name)
55+
else:
56+
caption = msg.caption
57+
58+
if DISABLE_CHANNEL_BUTTON:
59+
reply_markup = msg.reply_markup
60+
else:
61+
reply_markup = None
62+
5163
try:
52-
await msg.copy(chat_id=message.from_user.id, reply_markup = None)
64+
await msg.copy(chat_id=message.from_user.id, caption = caption, reply_markup = reply_markup)
5365
await asyncio.sleep(0.5)
5466
except FloodWait as e:
5567
await asyncio.sleep(e.x)
56-
await msg.copy(chat_id=message.from_user.id, reply_markup = None)
68+
await msg.copy(chat_id=message.from_user.id, caption = caption, reply_markup = reply_markup)
5769
except:
5870
pass
5971
return

0 commit comments

Comments
 (0)