MCPcopy Create free account
hub / github.com/TechifyBots/File-Stream-Bot / start

Function start

biisal/bot/plugins/commands.py:30–84  ·  view source on GitHub ↗
(b, m)

Source from the content-addressed store, hash-verified

28
29@StreamBot.on_message(filters.command("start") & filters.private )
30async def start(b, m):
31 if not await db.is_user_exist(m.from_user.id):
32 await db.add_user(m.from_user.id)
33 await b.send_message(
34 Var.NEW_USER_LOG,
35 f"#𝐍𝐞𝐰𝐔𝐬𝐞𝐫\n\n**᚛› 𝐍𝐚𝐦𝐞 - [{m.from_user.first_name}](tg://user?id={m.from_user.id})**"
36 )
37 if Var.UPDATES_CHANNEL != "None":
38 try:
39 user = await b.get_chat_member(Var.UPDATES_CHANNEL, m.chat.id)
40 if user.status == "kicked":
41 await b.send_message(
42 chat_id=m.chat.id,
43 text="ꜱᴏʀʀʏ ʏᴏᴜ ᴀʀᴇ ʙᴀɴɴᴇᴅ ᴛᴏ ᴜꜱᴇ ᴍᴇ ᴘʟᴇᴀꜱᴇ ᴄᴏɴᴛᴀᴄᴛ ᴏᴡɴᴇʀ ꜰᴏʀ ᴍᴏʀᴇ ᴅᴇᴛᴀɪʟꜱ.",
44 disable_web_page_preview=True
45 )
46 return
47 except UserNotParticipant:
48 await StreamBot.send_photo(
49 chat_id=m.chat.id,
50 photo="https://graph.org/file/a8095ab3c9202607e78ad.jpg",
51 caption=f"{m.from_user.mention},\n\n<b><i>⚠️ ᴊᴏɪɴ ᴍʏ ᴜᴘᴅᴀᴛᴇs ᴄʜᴀɴɴᴇʟ ᴛᴏ ᴜsᴇ ᴍᴇ.</i></b>\n\n<i>ᴅᴜᴇ ᴛᴏ sᴇʀᴠᴇʀ ᴏᴠᴇʀʟᴏᴀᴅ, ᴏɴʟʏ ᴏᴜʀ ᴄʜᴀɴɴᴇʟ sᴜʙsᴄʀɪʙᴇʀs ᴄᴀɴ ᴜsᴇ ᴛʜɪs ʙᴏᴛ 😊</i>",
52 reply_markup=InlineKeyboardMarkup(
53 [
54 [
55 InlineKeyboardButton("ᴊᴏɪɴ ɴᴏᴡ 🚩", url=f"https://telegram.me/{Var.UPDATES_CHANNEL}")
56 ]
57 ]
58 ),
59
60 )
61 return
62 except Exception:
63 await b.send_message(
64 chat_id=m.chat.id,
65 text="<b>ꜱᴏᴍᴇᴛʜɪɴɢ ᴡᴇɴᴛ ᴡʀᴏɴɢ <a href='https://telegram.me/TechifySupport'>ᴄʟɪᴄᴋ ʜᴇʀᴇ ꜰᴏʀ ꜱᴜᴘᴘᴏʀᴛ</a></b>",
66
67 disable_web_page_preview=True)
68 return
69 await StreamBot.send_photo(
70 chat_id=m.chat.id,
71 photo=random.choice(Var.PICS),
72 caption= TechifyBots.format(m.from_user.mention(style="md")),
73 reply_markup=InlineKeyboardMarkup(
74 [
75 [
76 InlineKeyboardButton("• ᴀʙᴏᴜᴛ •", callback_data="about"),
77 InlineKeyboardButton("• ʜᴇʟᴘ •", callback_data="help")
78 ],
79 [
80 InlineKeyboardButton("♻ ᴅᴇᴠᴇʟᴏᴘᴇʀ ♻", url="https://telegram.me/TechifyRahul")
81 ]
82 ]
83 )
84)
85
86@StreamBot.on_message(filters.command("help") & filters.private )
87async def help_cd(b, m):

Callers

nothing calls this directly

Calls 2

is_user_existMethod · 0.80
add_userMethod · 0.80

Tested by

no test coverage detected