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

35 lines
877 B
Python
Raw Normal View History

2023-01-10 13:52:44 +02:00
from pyrogram import filters
from pyrogram.client import Client
2023-01-10 13:52:44 +02:00
from pyrogram.types import Message
2023-02-14 12:38:54 +02:00
from classes.pyroclient import PyroClient
2023-10-15 18:40:56 +03:00
from modules import custom_filters
2023-02-14 12:38:54 +02:00
2023-01-10 13:52:44 +02:00
2023-10-15 18:40:56 +03:00
@Client.on_message(
custom_filters.mode_submit
& ~filters.scheduled
& filters.command(["start"], prefixes="/")
)
2023-10-15 19:14:22 +03:00
async def cmd_start(app: PyroClient, message: Message):
user = await app.find_user(message.from_user)
2023-06-28 11:37:18 +03:00
if user.banned:
return
2023-01-10 13:52:44 +02:00
2023-10-15 19:14:22 +03:00
await message.reply_text(app._("start", "message", locale=user.locale))
2023-03-09 12:33:02 +02:00
@Client.on_message(
2023-10-15 18:40:56 +03:00
custom_filters.mode_submit
& ~filters.scheduled
& filters.command(["rules", "help"], prefixes="/")
)
2023-10-15 19:14:22 +03:00
async def cmd_rules(app: PyroClient, message: Message):
user = await app.find_user(message.from_user)
2023-06-28 11:37:18 +03:00
if user.banned:
return
2023-10-15 19:14:22 +03:00
await message.reply_text(app._("rules", "message", locale=user.locale))