1
Fork 0
mirror of https://github.com/wlinator/luminara.git synced 2024-10-03 00:23:13 +00:00
Lumi/lib/checks.py

20 lines
445 B
Python
Raw Normal View History

2024-03-25 20:18:33 +00:00
from discord.ext import commands
2024-03-29 17:17:51 +00:00
2024-06-15 22:45:24 +00:00
from lib.exceptions import LumiExceptions
2024-06-20 10:34:03 +00:00
from services.config_service import GuildConfig
2023-06-19 14:20:17 +00:00
2024-03-25 20:18:33 +00:00
def birthdays_enabled():
async def predicate(ctx):
if ctx.guild is None:
return True
2023-06-19 14:20:17 +00:00
2024-03-25 20:18:33 +00:00
guild_config = GuildConfig(ctx.guild.id)
2024-03-04 10:25:00 +00:00
2024-03-25 20:18:33 +00:00
if not guild_config.birthday_channel_id:
2024-06-15 22:45:24 +00:00
raise LumiExceptions.BirthdaysDisabled
2024-03-04 10:25:00 +00:00
2024-03-25 20:18:33 +00:00
return True
2024-03-04 10:25:00 +00:00
2024-03-25 20:18:33 +00:00
return commands.check(predicate)