Added callback, command and inline to templates
This commit is contained in:
parent
54ee135660
commit
49b81d8b1a
10
plugins/callback.py
Normal file
10
plugins/callback.py
Normal file
@ -0,0 +1,10 @@
|
||||
from pyrogram import filters
|
||||
from pyrogram.client import Client
|
||||
from pyrogram.types import CallbackQuery
|
||||
|
||||
from modules.app import PyroClient
|
||||
|
||||
|
||||
@Client.on_callback_query(filters.regex("nothing")) # type: ignore
|
||||
async def callback_nothing(app: PyroClient, clb: CallbackQuery):
|
||||
await clb.answer(text="Nothing here...")
|
12
plugins/command.py
Normal file
12
plugins/command.py
Normal file
@ -0,0 +1,12 @@
|
||||
from pyrogram import filters
|
||||
from pyrogram.client import Client
|
||||
from pyrogram.types import Message
|
||||
|
||||
from modules.app import PyroClient
|
||||
|
||||
|
||||
@Client.on_message(
|
||||
~filters.scheduled & filters.private & filters.command(["start"], prefixes=["/"]) # type: ignore
|
||||
)
|
||||
async def command_start(app: PyroClient, msg: Message):
|
||||
await msg.reply_text("Welcome! I'm your bot!")
|
23
plugins/inline.py
Normal file
23
plugins/inline.py
Normal file
@ -0,0 +1,23 @@
|
||||
from pyrogram.client import Client
|
||||
from pyrogram.types import (
|
||||
InlineQuery,
|
||||
InlineQueryResultArticle,
|
||||
InputTextMessageContent,
|
||||
)
|
||||
|
||||
from modules.app import PyroClient
|
||||
|
||||
|
||||
@Client.on_inline_query() # type: ignore
|
||||
async def inline(app: PyroClient, inline_query: InlineQuery):
|
||||
await inline_query.answer(
|
||||
results=[
|
||||
InlineQueryResultArticle(
|
||||
title="Nothing here",
|
||||
input_message_content=InputTextMessageContent(
|
||||
"Please set up your InlineQuery in `plugins/inline.py`"
|
||||
),
|
||||
description="Please set up your InlineQuery in `plugins/inline.py`",
|
||||
)
|
||||
]
|
||||
)
|
Reference in New Issue
Block a user