66from pyrogram .errors import FloodWait
77
88from bot import Bot
9- from config import ADMINS , CHANNEL_ID
9+ from config import ADMINS , CHANNEL_ID , DISABLE_CHANNEL_BUTTON
1010from helper_func import encode
1111
1212@Bot .on_message (filters .private & filters .user (ADMINS ) & ~ filters .command (['start' ,'batch' ,'genlink' ]))
@@ -25,12 +25,21 @@ async def channel_post(client: Client, message: Message):
2525 string = f"get-{ converted_id } "
2626 base64_string = await encode (string )
2727 link = f"https://t.me/{ client .username } ?start={ base64_string } "
28- reply_markup = InlineKeyboardMarkup ([[InlineKeyboardButton ("🔁 Share URL" , url = f'https://telegram.me/share/url?url={ link } ' )]])
28+
29+ if DISABLE_CHANNEL_BUTTON :
30+ reply_markup = message .reply_markup
31+ else :
32+ reply_markup = InlineKeyboardMarkup ([[InlineKeyboardButton ("🔁 Share URL" , url = f'https://telegram.me/share/url?url={ link } ' )]])
33+
2934 await reply_text .edit (f"<b>Here is your link</b>\n \n { link } " , reply_markup = reply_markup , disable_web_page_preview = True )
3035 await post_message .edit_reply_markup (reply_markup )
3136
3237@Bot .on_message (filters .channel & filters .incoming & filters .chat (CHANNEL_ID ) & ~ filters .edited )
3338async def new_post (client : Client , message : Message ):
39+
40+ if not DISABLE_CHANNEL_BUTTON :
41+ return
42+
3443 converted_id = message .message_id * abs (client .db_channel .id )
3544 string = f"get-{ converted_id } "
3645 base64_string = await encode (string )
0 commit comments