Spoilers on custom filters
This commit is contained in:
parent
bd925418fd
commit
fd5e0b5b22
@ -10,7 +10,7 @@ from modules.database import col_spoilers
|
||||
from modules import custom_filters
|
||||
|
||||
# Spoiler command ==============================================================================================================
|
||||
@app.on_message(custom_filters.member & ~filters.scheduled & filters.private & filters.command(["spoiler"], prefixes=["/"]))
|
||||
@app.on_message(custom_filters.enabled_spoilers & custom_filters.member & ~filters.scheduled & filters.private & filters.command(["spoiler"], prefixes=["/"]))
|
||||
async def cmd_spoiler(app: Client, msg: Message):
|
||||
|
||||
try:
|
||||
|
@ -39,6 +39,9 @@ async def enabled_invites_check_func(_, __, msg: Message):
|
||||
async def enabled_dinovoice_func(_, __, msg: Message):
|
||||
return configGet("enabled", "features", "dinovoice")
|
||||
|
||||
async def enabled_spoilers_func(_, __, msg: Message):
|
||||
return configGet("enabled", "features", "spoilers")
|
||||
|
||||
async def filling_sponsorship_func(_, __, msg: Message):
|
||||
return True if col_tmp.find_one({"user": msg.from_user.id, "type": "sponsorship"}) is not None else False
|
||||
|
||||
@ -52,5 +55,6 @@ enabled_sponsorships = filters.create(enabled_sponsorships_func)
|
||||
enabled_warnings = filters.create(enabled_warnings_func)
|
||||
enabled_invites_check = filters.create(enabled_invites_check_func)
|
||||
enabled_dinovoice = filters.create(enabled_dinovoice_func)
|
||||
enabled_spoilers = filters.create(enabled_spoilers_func)
|
||||
|
||||
filling_sponsorship = filters.create(filling_sponsorship_func)
|
@ -66,6 +66,9 @@ async def any_stage(app: Client, msg: Message):
|
||||
|
||||
if holo_user.application_state()[0] != "fill" and holo_user.sponsorship_state()[0] != "fill":
|
||||
|
||||
if configGet("enabled", "features", "spoilers") is False:
|
||||
return
|
||||
|
||||
spoiler = col_spoilers.find_one( {"user": msg.from_user.id, "completed": False} )
|
||||
|
||||
if spoiler is None:
|
||||
|
Reference in New Issue
Block a user