Moved handlers to another location
This commit is contained in:
19
plugins/commands/general.py
Normal file
19
plugins/commands/general.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from os import getpid
|
||||
|
||||
from pyrogram import filters
|
||||
from pyrogram.client import Client
|
||||
from pyrogram.types import Message
|
||||
|
||||
from modules.app import app
|
||||
from modules.logger import logWrite
|
||||
from modules.utils import configGet, killProc, locale
|
||||
|
||||
|
||||
@app.on_message(~ filters.scheduled & filters.command(["kill", "die", "reboot"], prefixes=["", "/"]))
|
||||
async def cmd_kill(app: Client, msg: Message):
|
||||
|
||||
if msg.from_user.id == configGet("admin"):
|
||||
pid = getpid()
|
||||
logWrite(locale("shutdown", "console", locale=configGet("locale")).format(str(pid)))
|
||||
await msg.reply_text(locale("shutdown", "message", locale=configGet("locale")).format(str(pid)))
|
||||
killProc(pid)
|
17
plugins/commands/mode_submit.py
Normal file
17
plugins/commands/mode_submit.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from pyrogram import filters
|
||||
from pyrogram.client import Client
|
||||
from pyrogram.types import Message
|
||||
|
||||
from modules.app import app
|
||||
from modules.utils import configGet, jsonLoad, locale
|
||||
|
||||
|
||||
@app.on_message(~ filters.scheduled & filters.command(["start"], prefixes="/"))
|
||||
async def cmd_start(app: Client, msg: Message):
|
||||
if msg.from_user.id not in jsonLoad(configGet("blocked", "locations")):
|
||||
await msg.reply_text(locale("start", "message", locale=msg.from_user.language_code))
|
||||
|
||||
@app.on_message(~ filters.scheduled & filters.command(["rules", "help"], prefixes="/"))
|
||||
async def cmd_rules(app: Client, msg: Message):
|
||||
if msg.from_user.id not in jsonLoad(configGet("blocked", "locations")):
|
||||
await msg.reply_text(locale("rules", "message", locale=msg.from_user.language_code))
|
Reference in New Issue
Block a user