Added filling_sponsorship filter

This commit is contained in:
Profitroll 2023-01-04 21:57:11 +01:00
parent 4977b8f31a
commit 9431763e6b

View File

@ -4,7 +4,7 @@ usage in context of Holo Users."""
from os import path
from app import isAnAdmin
from modules.utils import configGet, jsonLoad
from modules.database import col_applications
from modules.database import col_applications, col_tmp
from pyrogram import filters
from pyrogram.types import Message
@ -35,6 +35,9 @@ async def enabled_invites_check_func(_, __, msg: Message):
async def enabled_dinovoice_func(_, __, msg: Message):
return configGet("enabled", "features", "dinovoice")
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
admin = filters.create(admin_func)
member = filters.create(member_func)
allowed = filters.create(allowed_func)
@ -45,3 +48,5 @@ 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)
filling_sponsorship = filters.create(filling_sponsorship_func)