@@ -15,7 +15,7 @@ async def channel_post(client: Client, message: Message):
1515 try :
1616 post_message = await message .copy (chat_id = client .db_channel .id , disable_notification = True )
1717 except FloodWait as e :
18- await asyncio .sleep (e .x )
18+ await asyncio .sleep (e .value )
1919 post_message = await message .copy (chat_id = client .db_channel .id , disable_notification = True )
2020 except Exception as e :
2121 print (e )
@@ -31,7 +31,13 @@ async def channel_post(client: Client, message: Message):
3131 await reply_text .edit (f"<b>Here is your link</b>\n \n { link } " , reply_markup = reply_markup , disable_web_page_preview = True )
3232
3333 if not DISABLE_CHANNEL_BUTTON :
34- await post_message .edit_reply_markup (reply_markup )
34+ try :
35+ await post_message .edit_reply_markup (reply_markup )
36+ except FloodWait as e :
37+ await asyncio .sleep (e .value )
38+ await post_message .edit_reply_markup (reply_markup )
39+ except Exception :
40+ pass
3541
3642@Bot .on_message (filters .channel & filters .incoming & filters .chat (CHANNEL_ID ))
3743async def new_post (client : Client , message : Message ):
@@ -46,6 +52,8 @@ async def new_post(client: Client, message: Message):
4652 reply_markup = InlineKeyboardMarkup ([[InlineKeyboardButton ("🔁 Share URL" , url = f'https://telegram.me/share/url?url={ link } ' )]])
4753 try :
4854 await message .edit_reply_markup (reply_markup )
49- except Exception as e :
50- print (e )
55+ except FloodWait as e :
56+ await asyncio .sleep (e .value )
57+ await message .edit_reply_markup (reply_markup )
58+ except Exception :
5159 pass
0 commit comments