88
99from bot import Bot
1010from config import CHANNEL_ID , ADMINS , START_MSG , OWNER_ID
11- from helper_func import subscribed
11+ from helper_func import subscribed , encode , decode
1212
1313@Bot .on_message (filters .command ('start' ) & filters .private & subscribed )
1414async def start_command (client : Client , message : Message ):
@@ -18,9 +18,7 @@ async def start_command(client: Client, message: Message):
1818 base64_string = text .split (" " , 1 )[1 ]
1919 except :
2020 return
21- base64_bytes = base64_string .encode ("ascii" )
22- string_bytes = base64 .b64decode (base64_bytes )
23- string = string_bytes .decode ("ascii" )
21+ string = await decode (base64_string )
2422 argument = string .split ("-" )
2523 if len (argument ) == 3 :
2624 try :
@@ -115,9 +113,7 @@ async def channel_post(client: Client, message: Message):
115113 await reply_text .edit_text ("Something went Wrong..!" )
116114 return
117115 string = f"get-{ post_message .message_id } "
118- string_bytes = string .encode ("ascii" )
119- base64_bytes = base64 .b64encode (string_bytes )
120- base64_string = base64_bytes .decode ("ascii" )
116+ base64_string = await encode (string )
121117 link = f"https://t.me/{ client .username } ?start={ base64_string } "
122118 reply_markup = InlineKeyboardMarkup ([[InlineKeyboardButton ("🔁 Share URL" , url = f'https://telegram.me/share/url?url={ link } ' )]])
123119 await reply_text .edit (f"<b>Here is your link</b>\n \n { link } " , reply_markup = reply_markup , disable_web_page_preview = True )
@@ -148,9 +144,7 @@ async def batch(client: Client, message: Message):
148144 await second_message .reply_text ("Forward from the Assigned Channel only..." , quote = True )
149145 continue
150146 string = f"get-{ f_msg_id } -{ s_msg_id } "
151- string_bytes = string .encode ("ascii" )
152- base64_bytes = base64 .b64encode (string_bytes )
153- base64_string = base64_bytes .decode ("ascii" )
147+ base64_string = await decode (string )
154148 link = f"https://t.me/{ client .username } ?start={ base64_string } "
155149 reply_markup = InlineKeyboardMarkup ([[InlineKeyboardButton ("🔁 Share URL" , url = f'https://telegram.me/share/url?url={ link } ' )]])
156150 await second_message .reply_text (f"<b>Here is your link</b>\n \n { link } " , quote = True , reply_markup = reply_markup )
0 commit comments