MCPcopy Create free account
hub / github.com/TechifyBots/Rename-Bot / auto_delete_fsub_and_start

Function auto_delete_fsub_and_start

plugins/fsub.py:60–81  ·  view source on GitHub ↗
(client: Client, user_id: int)

Source from the content-addressed store, hash-verified

58 return True
59
60async 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
83def is_auth_req_channel(_, __, update):
84 return update.chat.id in Config.AUTH_REQ_CHANNELS

Callers 2

join_reqsFunction · 0.85
check_normal_joinFunction · 0.85

Calls 3

get_fsub_msgMethod · 0.80
delete_fsub_msg_dbMethod · 0.80

Tested by

no test coverage detected