Removed legacy, fixed some bugs, improved spoilers #6

Merged
profitroll merged 9 commits from dev into master 2023-01-05 16:49:35 +02:00
4 changed files with 12 additions and 6 deletions
Showing only changes of commit 9e009aea43 - Show all commits

View File

@ -6,9 +6,11 @@ from modules.utils import should_quote, logWrite, locale
from modules.database import col_tmp, col_spoilers
from modules import custom_filters
# Cancel command ===============================================================================================================
@app.on_message((custom_filters.enabled_applications | custom_filters.enabled_sponsorships) & ~filters.scheduled & filters.command("cancel", prefixes=["/"]))
async def command_cancel(app: Client, msg: Message):
col_tmp.delete_many( {"user": msg.from_user.id} )
col_spoilers.delete_many( {"user": msg.from_user.id, "completed": False} )
await msg.reply_text(locale("cancel", "message", locale=msg.from_user), quote=should_quote(msg))
logWrite(f"Cancelling all ongoing tmp operations for {msg.from_user.id}")
# ==============================================================================================================================

View File

@ -9,8 +9,9 @@ from classes.holo_user import HoloUser, UserNotFoundError, UserInvalidError
from modules.utils import jsonLoad, should_quote, logWrite, locale, download_tmp, create_tmp, find_user
from modules import custom_filters
# Identify command =============================================================================================================
@app.on_message((custom_filters.enabled_applications | custom_filters.enabled_sponsorships) & ~filters.scheduled & filters.command("identify", prefixes=["/"]) & custom_filters.admin)
async def command_identify(app: Client, msg: Message):
async def cmd_identify(app: Client, msg: Message):
if len(msg.command) != 2:
await msg.reply_text(locale("identify_invalid_syntax", "message", locale=msg.from_user))
@ -61,3 +62,4 @@ async def command_identify(app: Client, msg: Message):
)
logWrite(f"User {msg.from_user.id} identified user {holo_user.id}")
# ==============================================================================================================================

View File

@ -6,6 +6,7 @@ from modules.utils import locale, should_quote, find_user
from classes.holo_user import HoloUser, LabelTooLongError
from modules import custom_filters
# Label command ================================================================================================================
@app.on_message(custom_filters.enabled_applications & ~filters.scheduled & filters.command(["label"], prefixes=["/"]) & custom_filters.admin)
async def cmd_label(app: Client, msg: Message):
@ -35,3 +36,4 @@ async def cmd_label(app: Client, msg: Message):
else:
await msg.reply_text(f"User not found")
# ==============================================================================================================================

View File

@ -9,9 +9,9 @@ from modules import custom_filters
pid = getpid()
# Shutdown command =============================================================================================================
# Reset commands command =======================================================================================================
@app.on_message(custom_filters.enabled_general & ~filters.scheduled & filters.private & filters.command(["resetcommands"], prefixes=["/"]) & custom_filters.admin)
async def cmd_kill(app: Client, msg: Message):
async def cmd_resetcommands(app: Client, msg: Message):
if msg.from_user.id == configGet("owner"):