(client: Client, user_id: int)
| 58 | return True |
| 59 | |
| 60 | async def auto_delete_fsub_and_start(client: Client, user_id: int): |
| 61 | if not await check_all_channels_joined(client, user_id): |
| 62 | return |
| 63 | msg_id = await tb.get_fsub_msg(user_id) |
| 64 | if msg_id: |
| 65 | try: |
| 66 | await client.delete_messages(user_id, msg_id) |
| 67 | except Exception: |
| 68 | pass |
| 69 | await tb.delete_fsub_msg_db(user_id) |
| 70 | user = await client.get_users(user_id) |
| 71 | bot_user = await client.get_me() |
| 72 | try: |
| 73 | await client.send_message( |
| 74 | user_id, |
| 75 | f"**{user.mention},\n\nʏᴏᴜ ʜᴀᴠᴇ ᴊᴏɪɴᴇᴅ ᴀʟʟ ʀᴇǫᴜɪʀᴇᴅ ᴄʜᴀɴɴᴇʟs.\n\nᴄʟɪᴄᴋ ᴛʜᴇ ʙᴜᴛᴛᴏɴ ʙᴇʟᴏᴡ ᴛᴏ ᴄᴏɴᴛɪɴᴜᴇ**", |
| 76 | reply_markup=InlineKeyboardMarkup( |
| 77 | [[InlineKeyboardButton("▶️ 𝖲𝗍𝖺𝗋𝗍", url=f"https://telegram.me/{bot_user.username}?start=start")]] |
| 78 | ) |
| 79 | ) |
| 80 | except Exception as e: |
| 81 | logging.error(f"Failed to send start link to {user_id}: {e}") |
| 82 | |
| 83 | def is_auth_req_channel(_, __, update): |
| 84 | return update.chat.id in Config.AUTH_REQ_CHANNELS |
no test coverage detected