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

17 lines
786 B
Python
Raw Normal View History

2023-01-10 13:52:44 +02:00
from pyrogram import filters
from pyrogram.client import Client
from pyrogram.types import Message
2023-02-14 12:38:54 +02:00
2023-01-10 13:52:44 +02:00
from modules.app import app
2023-02-14 12:38:54 +02:00
from modules.utils import configGet, jsonLoad, locale
2023-01-10 13:52:44 +02:00
@app.on_message(~ filters.scheduled & filters.command(["start"], prefixes="/"))
2023-01-10 14:06:24 +02:00
async def cmd_start(app: Client, msg: Message):
2023-01-10 13:52:44 +02:00
if msg.from_user.id not in jsonLoad(configGet("blocked", "locations")):
2023-01-10 14:06:24 +02:00
await msg.reply_text(locale("start", "message", locale=msg.from_user.language_code))
2023-01-10 13:52:44 +02:00
@app.on_message(~ filters.scheduled & filters.command(["rules", "help"], prefixes="/"))
2023-01-10 14:06:24 +02:00
async def cmd_rules(app: Client, msg: Message):
2023-01-10 13:52:44 +02:00
if msg.from_user.id not in jsonLoad(configGet("blocked", "locations")):
2023-01-10 14:06:24 +02:00
await msg.reply_text(locale("rules", "message", locale=msg.from_user.language_code))