Minor improvements
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
from pyrogram import filters
|
||||
from pyrogram.client import Client
|
||||
from pyrogram.types import Message
|
||||
|
||||
from classes.pyroclient import PyroClient
|
||||
|
||||
|
||||
@Client.on_message(
|
||||
@PyroClient.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!")
|
||||
async def command_start(app: PyroClient, message: Message):
|
||||
await message.reply_text(
|
||||
app._("start", "messages", locale=message.from_user.language_code)
|
||||
)
|
||||
|
@@ -1,13 +1,12 @@
|
||||
from pyrogram import filters
|
||||
from pyrogram.client import Client
|
||||
from pyrogram.types import Message
|
||||
|
||||
from classes.pyroclient import PyroClient
|
||||
|
||||
|
||||
@Client.on_message(
|
||||
@PyroClient.on_message(
|
||||
~filters.scheduled & filters.private & filters.command(["remove_commands"], prefixes=["/"]) # type: ignore
|
||||
)
|
||||
async def command_remove_commands(app: PyroClient, msg: Message):
|
||||
await msg.reply_text("Okay.")
|
||||
async def command_remove_commands(app: PyroClient, message: Message):
|
||||
await message.reply_text("Okay.")
|
||||
await app.remove_commands(command_sets=await app.collect_commands())
|
||||
|
Reference in New Issue
Block a user