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

19 lines
445 B
Python

from discord.ext import commands
from lib.exceptions import LumiExceptions
from services.config_service import GuildConfig
def birthdays_enabled():
async def predicate(ctx):
if ctx.guild is None:
return True
guild_config = GuildConfig(ctx.guild.id)
if not guild_config.birthday_channel_id:
raise LumiExceptions.BirthdaysDisabled
return True
return commands.check(predicate)