-
Notifications
You must be signed in to change notification settings - Fork 1
/
logger.py
31 lines (29 loc) · 878 Bytes
/
logger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from pyrogram import filters
import config
from strings import get_command
from AnonX import app
from AnonX.misc import SUDOERS
from AnonX.utils.database import add_off, add_on
from AnonX.utils.decorators.language import language
from strings.filters import command
# Commands
LOGGER_COMMAND = get_command("LOGGER_COMMAND")
@app.on_message(
command(LOGGER_COMMAND)
& SUDOERS
)
@language
async def logger(client, message, _):
usage = _["log_1"]
if len(message.command) != 2:
return await message.reply_text(usage)
state = message.text.split(None, 1)[1].strip()
state = state.lower()
if state == "enable":
await add_on(config.LOG)
await message.reply_text(_["log_2"])
elif state == "disable":
await add_off(config.LOG)
await message.reply_text(_["log_3"])
else:
await message.reply_text(usage)