Minor improvements

This commit is contained in:
2023-08-17 15:01:35 +02:00
parent ac36e70b7f
commit b3805d66ef
11 changed files with 108 additions and 29 deletions

View File

@@ -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)
)

View File

@@ -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())