diff --git a/plugins/callback.py b/plugins/callback.py new file mode 100644 index 0000000..3636deb --- /dev/null +++ b/plugins/callback.py @@ -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...") diff --git a/plugins/command.py b/plugins/command.py new file mode 100644 index 0000000..4d2007e --- /dev/null +++ b/plugins/command.py @@ -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!") diff --git a/plugins/inline.py b/plugins/inline.py new file mode 100644 index 0000000..f9285c9 --- /dev/null +++ b/plugins/inline.py @@ -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`", + ) + ] + )