forked from ShivangKakkar/StringSessionBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.py
More file actions
39 lines (31 loc) · 1.01 KB
/
basic.py
File metadata and controls
39 lines (31 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from data import Data
from pyrogram import Client, filters
from pyrogram.types import InlineKeyboardMarkup, Message
def filter(cmd: str):
return filters.private & filters.incoming & filters.command(cmd)
# Start Message
@Client.on_message(filter("start"))
async def start(bot: Client, msg: Message):
user = await bot.get_me()
mention = user.mention
await bot.send_message(
msg.chat.id,
Data.START.format(msg.from_user.mention, mention),
reply_markup=InlineKeyboardMarkup(Data.buttons)
)
# Help Message
@Client.on_message(filter("help"))
async def _help(bot: Client, msg: Message):
await bot.send_message(
msg.chat.id, Data.HELP,
reply_markup=InlineKeyboardMarkup(Data.home_buttons)
)
# About Message
@Client.on_message(filter("about"))
async def about(bot: Client, msg: Message):
await bot.send_message(
msg.chat.id,
Data.ABOUT,
disable_web_page_preview=True,
reply_markup=InlineKeyboardMarkup(Data.home_buttons),
)