Spoilers, major command system improvements #4

Merged
profitroll merged 27 commits from dev into master 2023-01-05 13:45:15 +02:00
Showing only changes of commit ff95d9556d - Show all commits

View File

@ -13,14 +13,26 @@ async def admin_func(_, __, msg: Message):
async def allowed_func(_, __, msg: Message): async def allowed_func(_, __, msg: Message):
return True if (col_applications.find_one({"user": msg.from_user.id}) is not None) else False return True if (col_applications.find_one({"user": msg.from_user.id}) is not None) else False
async def enabled_feature_func(_, __, msg: Message, feature: str): async def enabled_applications_func(_, __, msg: Message):
return configGet("enabled", "features", feature) return configGet("enabled", "features", "applications")
async def enabled_sponsorships_func(_, __, msg: Message):
return configGet("enabled", "features", "sponsorships")
async def enabled_warnings_func(_, __, msg: Message):
return configGet("enabled", "features", "warnings")
async def enabled_invites_check_func(_, __, msg: Message):
return configGet("enabled", "features", "invites_check")
async def enabled_dinovoice_func(_, __, msg: Message):
return configGet("enabled", "features", "dinovoice")
admin = filters.create(admin_func) admin = filters.create(admin_func)
allowed = filters.create(allowed_func) allowed = filters.create(allowed_func)
enabled_applications = filters.create(enabled_feature_func, kwargs={"feature": "applications"}) enabled_applications = filters.create(enabled_applications_func)
enabled_sponsorships = filters.create(enabled_feature_func, kwargs={"feature": "sponsorships"}) enabled_sponsorships = filters.create(enabled_sponsorships_func)
enabled_warnings = filters.create(enabled_feature_func, kwargs={"feature": "warnings"}) enabled_warnings = filters.create(enabled_warnings_func)
enabled_invites_check = filters.create(enabled_feature_func, kwargs={"feature": "invites_check"}) enabled_invites_check = filters.create(enabled_invites_check_func)
enabled_dinovoice = filters.create(enabled_feature_func, kwargs={"feature": "dinovoice"}) enabled_dinovoice = filters.create(enabled_dinovoice_func)