This repository has been archived on 2024-10-10. You can view files and clone it, but cannot push or open issues or pull requests.
TelegramBot/plugins/commands/remove_commands.py

16 lines
590 B
Python
Raw Permalink Normal View History

2023-08-27 23:43:16 +03:00
from pyrogram import filters
from pyrogram.types import Message
from classes.pyroclient import PyroClient
2023-08-30 15:41:34 +03:00
from modules import custom_filters
2023-08-27 23:43:16 +03:00
@PyroClient.on_message(
2023-08-30 15:41:34 +03:00
~filters.scheduled & filters.private & filters.command(["remove_commands"], prefixes=["/"]) & ~custom_filters.context # type: ignore
2023-08-27 23:43:16 +03:00
)
async def command_remove_commands(app: PyroClient, message: Message):
2023-08-30 12:01:59 +03:00
user = await app.find_user(message.from_user)
await message.reply_text(app._("commands_removed", "messages", locale=user.locale))
2023-08-27 23:43:16 +03:00
await app.remove_commands(command_sets=await app.collect_commands())