forked from swatv3nub/PyrogramBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.py
More file actions
43 lines (32 loc) · 1.29 KB
/
start.py
File metadata and controls
43 lines (32 loc) · 1.29 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
40
41
42
43
from PyrogramBot import app
from PyrogramBot.__main__ import BOT_NAME
from PyrogramBot.config import OWNER_ID
from PyrogramBot.utils.errors import capture_err
from pyrogram import filters
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
__MODULE__ = "Basic"
__HELP__ = """/start - Start the bot with Inline Buttons
/help - Help Menu
"""
keyboard = InlineKeyboardMarkup(
[
[
InlineKeyboardButton(
text="Example Inline Link Button",
url=f"https://github.com/swatv3nub/PyrogramBot",
),
InlineKeyboardButton(
text="Example Inline Query Button",
callback_data="example",
)
]
#Start
@app.on_message(filters.command("start"))
@capture_err
async def start(_, message):
start_text=f"Hello {message.from_user.mention}, I am {BOT_NAME}\n\nMy Onwer is [{OWNER_ID}](tg://user?id={OWNER_ID})"
await message.reply_text(start_text, reply_markup=keyboard, parse_mode="markdown")
@app.on_callback_query(filters.regex("example"))
async def example(_, CallBackQuery):
await app.answer_callback_query(CallbackQuery.id, "Surprise!", show_alert=True)
#Help { in __main__.py }